evc

WSAStartup link error

a 夏天 提交于 2019-12-02 06:32:40
问题 I am using EVC++ and I want to compile the program which uses the sockets. I've included #include <winsock2.h> And I have included in project properties a path to Ws2.lib But still get the error at link step: error LNK2019: unresolved external symbol WSAStartup referenced in function ... How to resolve this problem? 回答1: #pragma comment(lib,"WS2_32") after all #include 's 回答2: You haven't linked your program with the winsock library. The Winsock 2 library is called ws2_32.lib (static) or ws2

WSAStartup link error

限于喜欢 提交于 2019-12-02 00:46:10
I am using EVC++ and I want to compile the program which uses the sockets. I've included #include <winsock2.h> And I have included in project properties a path to Ws2.lib But still get the error at link step: error LNK2019: unresolved external symbol WSAStartup referenced in function ... How to resolve this problem? #pragma comment(lib,"WS2_32") after all #include 's You haven't linked your program with the winsock library. The Winsock 2 library is called ws2_32.lib (static) or ws2_32.dll (dynamic). It should already be on your system; you just need to tell your compiler/linker to link your