First of all, I know this question is all over this site but I have looked at almost all of them and can\'t seem to find out what is wrong. This is in VS 2012. Thanks.
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.