Jump to content
  • Advertisement
Sign in to follow this  
levijgraham

trying to use winsock2

This topic is 2528 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey i am trying to run a simple chat program in c++ and a keep getting this error. Can anyone tell me how to fix it?


1>------ Build started: Project: RTS, Configuration: Debug Win32 ------
1>Build started 8/8/2011 5:43:59 PM.
1>InitializeBuildStatus:
1> Touching "Debug\RTS.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1> Socket.cpp
1>c:\users\levi\desktop\game\testfolder\rts\socket.cpp(19): warning C4551: function call missing argument list
1> Generating Code...
1>Socket.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "public: __thiscall Socket::Socket(void)" (??0Socket@@QAE@XZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function "public: bool __thiscall Socket::SendData(char *)" (?SendData@Socket@@QAE_NPAD@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "public: bool __thiscall Socket::ReceiveData(char *,int)" (?ReceiveData@Socket@@QAE_NPADH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: void __thiscall Socket::CloseConnection(void)" (?CloseConnection@Socket@@QAEXXZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function "public: void __thiscall ServerSocket::Listen(void)" (?Listen@ServerSocket@@QAEXXZ)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function "public: void __thiscall ServerSocket::StartHosting(int)" (?StartHosting@ServerSocket@@QAEXH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: void __thiscall ServerSocket::StartHosting(int)" (?StartHosting@ServerSocket@@QAEXH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "public: void __thiscall ServerSocket::StartHosting(int)" (?StartHosting@ServerSocket@@QAEXH@Z)
1>Socket.obj : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: void __thiscall ServerSocket::StartHosting(int)" (?StartHosting@ServerSocket@@QAEXH@Z)
1>C:\Users\levi\Desktop\Game\TestFolder\RTS\Debug\RTS.exe : fatal error LNK1120: 11 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.97
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Share this post


Link to post
Share on other sites
Advertisement
Link to Ws2_32.lib


Project->Properties (Alt+F7)
Select Linker from the left pane, then Input.
Paste Ws2_32.lib in Additional Dependencies, then try a build.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!