Saturday 15 June 2013

Compiling in C in VisualStudio 2010 gives MSVCRTD.lib(crtexe.obj) : error LNK2019 -



Compiling in C in VisualStudio 2010 gives MSVCRTD.lib(crtexe.obj) : error LNK2019 -

visual studio 2010, during c compile, complains about

msvcrtd.lib(crtexe.obj) : error lnk2019 , fatal error lnk1120

i've read must alter configurations of project under properties-->linker-->subsystem--> subsystem/console(/subsystem:console) that's not case.

the code should print line of text

#include <stdio.h> #include <stdlib.h> int main() { printf("as installed, vs2010 can't compile. or maybe i'm doing wrong."); homecoming 0; }

include files correctly installed in include directory.

edit: finish error messages are:

msvcrtd.lib(crtexe.obj) : unresolved external symbol _main referenced in function ___tmaincrtstartup

and

fatal error lnk1120: 1 unresolved external link

as have stated in question in many cases issue because people select wrong project type in project setup wizard in visual studio. using "console application" create linker _main while "windows application" create linker _winmain (see winmain on msdn). however, if subsystem right, simple error can lead linking failures (unknowingly) not defining _main. if reason _main in source not generated (possibilities include source not beingness included in build reason, function beingness not generated because of macro definitions guard it, etc.) still errors see.

c visual-studio-2010

No comments:

Post a Comment