When Visual Studio created your project, it configured it to link in various commonly-used libraries, such as user32.lib and kernel32.lib. There are two other libraries that need to be added to the project - ws2_32.lib and crypt32.lib.
To do this, right-click on your Project (not on the Solution) in the Solution Explorer, and select Properties. When the following Property Pages window appears, be sure that the Configuration control and the Platform control (both at the top of the window) are set to All Configurations and All Platforms, as shown in the image below:
After selecting All Configurations and All Platforms, navigate to Configuration Properties > Linker > Input > Additional Dependencies.
If the list of Additional Dependencies does not contain ws2_32.lib and crypt32.lib, add them. Note that semicolons are used to separate each file in the list. Note also that it does not matter what order the files are listed in; you can add the two new files to the front of the list if you want.
Do not dismiss the Property Pages window; you will need it for the next steps.