Setting up Visual Studio for a console projectWin32Developer.com contains a mixture of console and Windows based tutorials. In order to guarantee that these tutorials compile and run first time, every time, please follow these simple steps in order to set up Visual Studio.
At the start of every tutorial you will notice a 'Prerequisites' section, which advises what type of project you should be using.
Be sure that you have set up Visual Studio for the correct project type for the tutorial, to ensure that you do not recieve compile and linker errors.
An example of what the 'Prerequisites' section looks like is as follows.
PrerequisitesProject type: Console
Include files: winsock2.h, iostream.h
Library files: ws2_32.lib
Configuring the 'Console' projectStart Visual Studio.net.
Select 'File', then 'New Project'
Choose 'Win32 Console Application' and choose a name for the project. Then select OK.
You will see the following screen.
Select 'Empty project' and click 'Finish'
Right click on 'Source files' and select 'Add -> New Item'
Choose 'C++ File' and enter 'main.cpp' into the name field.
Now Visual Studio is set up and ready to go for the 'console' type of tutorials.