We are migrating a C++ application from Ice-3.2/VisualStudio2005 to a Ice-3.3/VisualStudio2008. The application has not been changed, and we are running an un-modified Ice-3.3.0 installation.
The application build generates some unusual linker errors. Here are the link errors (complete build log attached to post):
CryptoError.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@QBE_NABU012@@Z) already defined in AvEncrypter.obj
CryptoError.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@$$FQBE_NABU012@@Z) already defined in AvEncrypter.obj
CryptoError.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@QAE@ABVTime@2@0ABV?$Handl e@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
CryptoError.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@$$FQAE@ABVTime@2@0ABV?$Ha ndle@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
HgLtServant.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@QBE_NABU012@@Z) already defined in AvEncrypter.obj
HgLtServant.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@$$FQBE_NABU012@@Z) already defined in AvEncrypter.obj
HgLtServant.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@QAE@ABVTime@2@0ABV?$Handl e@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
HgLtServant.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@$$FQAE@ABVTime@2@0ABV?$Ha ndle@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
HgLtService.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@QBE_NABU012@@Z) already defined in AvEncrypter.obj
HgLtService.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@$$FQBE_NABU012@@Z) already defined in AvEncrypter.obj
HgLtService.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@QAE@ABVTime@2@0ABV?$Handl e@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
HgLtService.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@$$FQAE@ABVTime@2@0ABV?$Ha ndle@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
Logging.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@QBE_NABU012@@Z) already defined in AvEncrypter.obj
Logging.obj : error LNK2005: "public: bool __thiscall IceUtil::Timer::Token:perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@$$FQBE_NABU012@@Z) already defined in AvEncrypter.obj
Logging.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@QAE@ABVTime@2@0ABV?$Handl e@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
Logging.obj : error LNK2005: "public: __thiscall IceUtil::Timer::Token::Token(class IceUtil::Time const &,class IceUtil::Time const &,class IceUtil::Handle const &)" (??0Token@Timer@IceUtil@@$$FQAE@ABVTime@2@0ABV?$Ha ndle@VTimerTask@IceUtil@@@2@@Z) already defined in AvEncrypter.obj
..\current\deliverables\EncServices.exe : fatal error LNK1169: one or more multiply defined symbols found
Here is the linker command-line:
/OUT:"..\current\deliverables\EncServices.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Ice-3.3.0-VC90\lib" /LIBPATH:"..\..\..\external_dependencies\uclmm\curr ent\deliverables\lib" /LIBPATH:"..\..\..\external_dependencies\rock\curre nt\deliverables\lib" /LIBPATH:"..\..\..\ice_definitions\current\delivera bles" /LIBPATH:"C:\Program Files\Intel\IPP\5.3.3.082\ia32\lib" /MANIFEST /MANIFESTFILE:"Release\EncServices.exe.intermediate .manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\trees\refactor\halo\encryption\HgLtService CPP\current\deliverables\EncServices.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /FIXED:No /MACHINE:X86 /ERRORREPORT:PROMPT ice.lib iceutil.lib ippcpmerged.lib HaloICE2CPPStaticLib.lib _Rock.lib _uclmm.lib ippcorel.lib WS2_32.Lib winmm.lib. kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
The HaloICE2CPPStaticLib.lib is the result of the compilation of the sliceToCpp-generated files. The ippcmerged.lib, _Rock.lib, and _uclmm.lib, ippcorel.lib have to do with encryption and RTP support - they are non-ice-related. The winmm.lib provides support for modifying the windows clock interrupt frequency. The rest are libraries which VS adds to the mix.
None of the code in our application makes any explicit reference to the duplicate symbols - i.e. IceUtil::Timer.
I've spent a great deal of time tracking down and excluding the 'bone headed' build errors, including tracking down the advice MSDN gives on the subject:
Linker Tools Error LNK2005 (C++)
I am assuming that these symbols are exported by iceutil.lib, but I can't find what looks like a match between the output of LibDump (George Poulose's Home Page) on iceutil.lib and the linker error output, but I'm no C++ guru and may just be thrown off by the name mangling.
What's even more strange, is if I remove the ice.lib and iceutil.lib from the linker input list, the errors are still present (which makes no sense), only now they are joined by a bunch more LNK2001 unresolved symbol errors (which makes sense).
Any ideas?
Thanks
Dirk

perator<(struct IceUtil::Timer::Token const &)const " (??MToken@Timer@IceUtil@@QBE_NABU012@@Z) already defined in AvEncrypter.obj
Reply With Quote
rompt /FU "c:\trees\refactor\halo\external_dependencies\log4 net\current\deliverables\log4net.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Sys tem.XML.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Sys tem.dll"
.