|Last Modification: December 11, 1999|
Why do I get a "LNK2001: unresolved external symbol _main" error or "LNK2001: unresolved external symbol _WinMain" when I try to build my application?
This usually happens when you create the wrong type of project for you application. In the first case, you chose "Win32 Application" when you should have selected "Win32 Console Application". On the second case, well, it's the other way.
There are two ways to fix it: (1) Create a new project of the correct type,
and readd all your files too it, or (2) change the type of the current project.
This can be easily accomplished. Select
Project -> Settings from the menu,
and go to the
Link tab. There, in the edit control at the bottom, look for the
/subsystem switch and change it to
"/subsystem:windows" as appropriate.