471,594 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

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


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
2 6769
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
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.

Similar topics

3 posts views Thread by beachboy | last post: by
32 posts views Thread by SAL | last post: by
2 posts views Thread by Will hunting | last post: by
4 posts views Thread by Winks | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.