error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
Solution 1:
Even if your project has a main()
method, the linker sometimes gets confused. You can solve this issue in Visual Studio 2010 by going to
Project -> Properties -> Configuration Properties -> Linker -> System
and changing SubSystem
to Console.
Solution 2:
We also had this problem. My colleague found a solution. It turned up to be a redefinition of "main" in a third party library header:
#define main SDL_main
So the solution was to add:
#undef main
before our main function.
This is clearly a stupidity!