if there is “#pragma comment(lib, “ws2_32.lib”)” included or you see some errors like:

[Linker error] undefined reference to `WSAStartup@8′

[Linker error] undefined reference to `socket@12′

[Linker error] undefined reference to `WSACleanup@0′

[Linker error] undefined reference to `htons@4′

[Linker error] undefined reference to `bind@12′

[Linker error] undefined reference to `listen@8′

[Linker error] undefined reference to `WSAAsyncSelect@16′

ld returned 1 exit status

Please add “-lwsock32.dll” at Project>Linker settings>Other linker optios.

, , ,