The problem is you are not linking against the Ws2_32.lib library. To fix this you can add that to your additional dependencies tab of linker/Input settings for your project. Alternatively (as pointed out by SChepurin in the comments) you can add

#pragma comment(lib, "Ws2_32.lib")

to a source file of your project.


Another way is that click right in your project in visual studio and go to following path and add "Ws2_32.lib" in that. Linker>Input> Additional Dependencies

enter image description here


Add runtimeobject.lib to the linker Additional Dependencies (in the project property page, under Linker->Input).