Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup j:\jinais\my documents\visual studio 2010\Projects\kkjh\kkjh\MSVCRTD.lib(crtexew.obj)
I get these errors when I compile a program. I stripped the program down to
1 2 3 4
int main() {
return 0;
}
and kept on getting the same error. I compiled the initial program on another OS and it worked, came back to previous os, ran the project file from there and it worked. I copied the contents of the cpp file and created a new project and I get the same error. I use Visual Studio 2010. Is this a problem with my IDE or OS? My first OS is Vista and the other is XP. Any ideas?
The actual problem is that you had your project configured to be a WinAPI project instead of a normal console project.
For WinAPI projects, the entry point is "WinMain" (not the typical "main"). The linker error is telling you that it can't find WinMain.
The solution here would be to change your project settings so that it builds a console program. Or -- start a new project and make sure you select Console Program from the list of options.