Linker Error
-
Tuesday, August 17, 2010 8:39 PM
I have successfully built the "Hello World" sample, but anything more complex I get a linker error.
------ Build started: Project: sizeof4, Configuration: Debug Win32 ------
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
C:\Documents and Settings\Big Daddy\My Documents\Visual Studio 2010\Projects\sizeof4\Debug\sizeof4.exe : fatal error LNK1120: 1 unresolved
externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========Any help is appreciated, thank you.
Answers
-
Wednesday, August 25, 2010 1:04 AM
This error says a function that was referenced in your code was not found, so your program couldn't be linked into an .exe. The function that was not found is _mainCRTStartup. This is the startup function provided by the C library for a console app.Is there anything set in Project properties Linker | Advanced | Entry Point? If so, reset it to blank so the default is used.How did you create this project? Did you start with the AppWizard or did you open this project and convert it from a previous Visual Studio version to VS 2010? Perhaps there was an error in that conversion. It is a pretty basic error that shouldn't be happening normally.-- David"BobCap" wrote in message news:bbc5acbd-ae1a-401c-b671-8608555b3b5a@communitybridge.codeplex .com...LINK : error LNK2001: unresolved external symbol _mainCRTStartup
Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com- Marked As Answer by Martin RichterMVP, Moderator Wednesday, August 25, 2010 6:26 AM
All Replies
-
Thursday, August 19, 2010 4:41 AMModerator
Hi BobCap,
There are lots of possible situation to cause LNK2001, for example:
· When upgrading a managed library or web service project from Visual C++ 2003, the /Zl compiler option is added to the Command Line property page. This will cause LNK2001.
· What the code asks for doesn't exist (the symbol is spelled incorrectly or uses the wrong case, for example).
· The code asks for the wrong thing (you are using mixed versions of the libraries, some from one version of the product, others from another version).
For more information about this error, please check http://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx
I also recommend you double check your code.
If it is possible, you’d better to post some parts of your code, which is helpful for us to investigate the issue. It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.
Cheers,
Yi
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer by Yi Feng LiMicrosoft Contingent Staff, Moderator Tuesday, August 24, 2010 3:43 AM
- Unmarked As Answer by Martin RichterMVP, Moderator Wednesday, August 25, 2010 6:26 AM
-
Wednesday, August 25, 2010 1:04 AM
This error says a function that was referenced in your code was not found, so your program couldn't be linked into an .exe. The function that was not found is _mainCRTStartup. This is the startup function provided by the C library for a console app.Is there anything set in Project properties Linker | Advanced | Entry Point? If so, reset it to blank so the default is used.How did you create this project? Did you start with the AppWizard or did you open this project and convert it from a previous Visual Studio version to VS 2010? Perhaps there was an error in that conversion. It is a pretty basic error that shouldn't be happening normally.-- David"BobCap" wrote in message news:bbc5acbd-ae1a-401c-b671-8608555b3b5a@communitybridge.codeplex .com...LINK : error LNK2001: unresolved external symbol _mainCRTStartup
Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com- Marked As Answer by Martin RichterMVP, Moderator Wednesday, August 25, 2010 6:26 AM
-
Saturday, August 28, 2010 12:30 PM
I should have said that I was working with Visual C++ 2010 Express in an attempt to learn C++ from my past programmig in other legacy languages. I thank you for your help.

