[Botan-devel] Linker errors in VS2005

Boris boriss at web.de
Mon Sep 24 17:16:37 EDT 2007


After playing around with Botan I tried to build a rather small project in
VS2005 - while compiling works I see various linker errors: 

msvcprtd.lib(MSVCP80D.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 at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at XZ)
already defined in libbotan.lib(pk_keys.obj) 
... 
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)"
(?_Getgloballocale at locale@std@@CAPAV_Locimp at 12@XZ) already defined in
msvcprtd.lib(MSVCP80D.dll) 
... 
LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined
in MSVCRTD.lib(MSVCR80D.dll) 
... 
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::compare(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)const "
(?compare@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QBEHA
BV12@@Z) already defined in libbotan.lib(config.obj) 
... 
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other
libs; use /NODEFAULTLIB:library 
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
libs; use /NODEFAULTLIB:library 

It seems like that the linker errors are somehow caused by libraries which
are statically linked by Botan. As I followed the description in
building.pdf closely (building my Botan library with configure.pl and nmake)
and didn't read anything in the documentation about linker errors I wonder
if I did anything wrong? My expectation after reading the documents was that
if libbotan.lib has been built successfully everything should work out of
the box with the default compiler and linker settings in VS2005? 

Boris 




More information about the botan-devel mailing list