By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,375 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,375 IT Pros & Developers. It's quick & easy.

STL template symbol "already defined in" errors ...

P: n/a

I'm getting "multiply defined" errors on STL symbols. Isn't this a
linker error ? By definition, doesn't the compiler/linker need to
guarentee the "one definition rule".

Linking...

msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::~basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)"
(??1?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@XZ)
already defined in SyncTx.lib(SyncTr.obj)

msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(char const *)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@PBD@Z)
already defined in SyncTx.lib(SyncTr.obj)

msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@ABV01@@Z)
already defined in SyncTx.lib(SyncTr.obj)

.... lots o these cut

work.win32/NMFinger.exe : fatal error LNK1169: one or more multiply
defined symbols found

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
check project properties
C++
Code Generation
Runtime Library

ex (Multi-threaded Debug DLL (/MDd))

and make sure they are compatible bewteeen the projects in the solution
Nov 17 '05 #2

P: n/a
jrainey wrote:
check project properties
C++
Code Generation
Runtime Library

ex (Multi-threaded Debug DLL (/MDd))

and make sure they are compatible bewteeen the projects in the solution


This turned out to be an ATL/MFC madness.

First I tried one suggestion to define _AFXDLL and that worked for one
binary but then it broke another binary.

So I'm now trying the "Use of MFC" and "Use of ATL" combinations.

The other problem confounding things is that I have a library from MS
(which I can't get compiled in different modes) that I think is build in
/MT (but it uses no system run times).

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.