What are these errors?

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)

Error 2 error LNK1120: 1 unresolved externals j:\jinais\my documents\visual studio 2010\Projects\kkjh\Debug\kkjh.exe 1


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?




Maybe it's your Visual Studio... try making a new project or something if don't work it should be VS.
save it and run again,
some visual studio are freak.
it needs to restart and run again if it doesnt work try to debug again
Turns out to be VS related errors. I work on XP with no such error. Thanks guys!
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.
Wow! Very silly mistake and I never could have figured that out myself. Thanks Disch!
Topic archived. No new replies allowed.