The problem lies here, you are missing the ws2_32.lib file in your project, assuming you have the platform sdk installed, you need to do the following:
(Press Alt + f7) or Project -> "yourprojectname" Properties -> +Configuration Properties -> +Linker -> Input, You are missing the ws2_32.lib addition dependencie, click -> Additional Dependencies, a button which reads "..." should appear at the end of that line, click it, and add ws2_32.lib in the text box, then "OK" out of everything, and try compiling your project...
If you're getting compiler errors like Nirvana try including winsock2.h before you include windows.h.
#include <winsock2.h>
#include <windows.h>