You have created a Windows Application project, therefor - linker is expecting WinMain function to be defined. It's an entry point.
From your code, it is clear, that what you wanted was a Console Application project, so that linker would know that the function "main" is the entry point function.
You can change this setting in project properties (right-click on the project in solution explorer, choose properties). Now, on the left side, choose "Configuration properties -> Linker -> System" and on the right side, set SubSystem to "Console (/SUBSYSTEM:CONSOLE)".