For Programmers: Free Programming Magazines  


Home > Archive > VC STL > March 2005 > Linking libs using STL gives LNK2005 (multiple definition of symbols)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Linking libs using STL gives LNK2005 (multiple definition of symbols)
Jörg Zieren

2005-03-10, 8:59 am

Hi,

in a project I am currently trying to migrate from 6.0 to 7.1, I get
numerious LNK2005 errors in 7.1 complaining about multiple definitions of
several STL elements:

error LNK2005: "public: __thiscall std::map<class std::basic_string<...
error LNK2005: "protected: static struct std::pair<class std::basic_string<...
....

I am trying to build a lib that depends on several other libs that are
linked with the below command line (i.e. ignoring libcmtd.lib and
libcpmtd.lib). The above symbols are said to have been defined in the
objects files of one of the libs that gets linked with the lib currently
being built.

/OUT:".\../../#Debug/modules_common.dll" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"..\\" /LIBPATH:"L:\ltilib\lib" /LIBPATH:"L:\ltilib\win\lib" /DLL
/NODEFAULTLIB:"libcmtd.lib" /NODEFAULTLIB:"libcpmtd.lib" /DEBUG
/PDB:".\../../#Debug/modules_common.pdb"
/IMPLIB:".\../../#Debug/modules_common.lib" /MACHINE:X86 ltilib7_dmfcd.lib
"\tmp\ugNet\unifiedGesture\#Debug\lib_ug.lib"
\tmp\ugNet\unifiedGesture\lib\pch.lib
"\tmp\ugNet\unifiedGesture\#Debug\lib_fx.lib"
" \tmp\ugNet\unifiedGesture\#Debug\lib_htm
l.lib"

Does anyone have an idea what causes this error, and how to fix it? Do I
have to ignore more libraries besides libcmtd.lib and libcpmtd.lib?

Any help greatly appreciated!

-Joerg
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com