If you think that it is a bug in Visual Studio, it is not. Refer the following URL.
#pragma comment
You need to link the wsock32.lib or ws2_32.lib ( Winsock Library ) to use the APIs that are needed for WinSock programming in Windows. Visual Studio by default links the kernel32.lib user32.lib gdi32.lib libraries when you build a project. If you are using other libraries ( e.g. ws2_32.lib, ComCtl32.lib ), you will have to explicitly tell that to the linker.
One way is to use the method you have already used. Other methods are setting the "Additional Libraries Used" field in Project Properties->Linker->Input.
Also you can select add Existing Item to Project and browse for the LIbraries you are using and select them. But this method is not encouraged because this uses Absolute Paths and if you compile it in another machine where the Library Path is different, the linker will fail.
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115