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!
Gravatar # re: Upgrading to Visual Studio 2005 - Part 3
by Erivelton Lima at 9/15/2008 10:54 AM

Hi!! how do you this problem? i have this problem

help!!
Gravatar # re: Upgrading to Visual Studio 2005 - Part 3
by Gaurav Srivastava at 10/8/2008 8:46 AM

Thanks 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...

Many many thanks to you! This solved my problem!!!
Gravatar # re: Upgrading to Visual Studio 2005 - Part 3
by Manish at 10/30/2008 9:24 AM

I have converted .net VS 2003 (VC ++)applicaiton to VS 2005 and I could not find Zl entries any where in configuration settings and i am getting some linking error:
main.obj : error LNK2019: unresolved external symbol "void __cdecl ckAddRow(unsigned long,unsigned long,unsigned long,wchar_t *,long)" (?ckAddRow@@YAXKKKPA_WJ@Z) referenced in function "void __cdecl Dump(void)" (?Dump@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "void __cdecl ckOpenTable(wchar_t *)" (?ckOpenTable@@YAXPA_W@Z) referenced in function "void __cdecl Dump(void)" (?Dump@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl ckExFormatStringEx(struct HINSTANCE__ *,unsigned long,wchar_t *,unsigned int,...)" (?ckExFormatStringEx@@YAKPAUHINSTANCE__@@KPA_WIZZ) referenced in function "void __cdecl Dump(void)" (?Dump@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl ckExInit(unsigned long,wchar_t * const * const,struct structarg * *)" (?ckExInit@@YAKKQBQA_WPAPAUstructarg@@@Z) referenced in function _wmain
.\Release/ckVC.exe : fatal error LNK1120: 4 unresolved externals
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: