Upgrading to Visual Studio 2005 - Part 3

When you upgrade a C++ project from Visual Studio 2003 to Visual Studio 2005, the conversion may decide to add the /Zl (upper case Z, lower case L) option to the compiler command line.  This appears in the project properties at Configuration Properties -> C/C++ -> Command Line in the text box on the right.  The result of this can be that the link fails with:

error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)

The solution is simply to remove /Zl from the text box.  Note that /Zl can also be specified at Configuration Properties -> C/C++ -> Advanced by setting Omit Default Library Name to Yes (/Zl).

Print | posted @ Sunday, October 01, 2006 10:02 AM

Comments on this entry:

Gravatar # re: Upgrading to Visual Studio 2005 - Part 3
by None at 8/28/2007 8:19 PM

Boss, this comment is a life saver. It takes care of plenty of linking errors like

error LNK2028: unresolved token (0A000007) "extern "C" void __clrcall ___CxxCallUnwindDtor...

error LNK2019: unresolved external symbol "extern "C" int __clrcall _atexit_m...

thanks!

Gravatar # re: Upgrading to Visual Studio 2005 - Part 3
by Steffan at 6/19/2008 6:58 AM

Thanks!

That solved my problem!

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 7 and 7 and type the answer here: