You create a Windows project instead of a Console project. Windows application starts from
WinMain()
while console application starts from
main()
. Yours is a console application. You have 2 options to fix it: either recreate a new console application project and copy over your source code or follow the steps below.
- Right-click on your project in Solution Explorer and click "Properties" on the popup menu.
- Make sure Configuration and Platform on the Properties Page is same as your current setting.
- Go to Linker->System
- On the Subsystem dropdown, change from Windows(/Subsystem:Windows) to Console(/Subsystem:Console)
- Click Ok to close the Properties Page and rebuild your project.