I have the following error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup,
There are a lot of threads relating to this error bu
In my case, it's because I accidentally removed (not deleted) the stdafx.h
and targetver.h
files in the Header Files section.
Add these files back to Header Files and the problem is solved.
I had these:
#pragma comment( linker, "/entry:\"mainCRTStartup\"" ) // set the entry point to be main()
I just need to comment that (by prepending //
) and it's good.