WSAStartup link error

erjik picture erjik · Jul 29, 2010 · Viewed 10.6k times · Source

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?

Answer

Mickey Tin picture Mickey Tin · Nov 24, 2012

#pragma comment(lib,"WS2_32") after all #include's