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.
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