[Botan-devel] Linker errors in VS2005

Joel Low joel at joelsplace.sg
Mon Sep 24 17:37:44 EDT 2007

IIRC configure.pl does not set the RTL by default to /MD (which is what the
IDE uses). You'll need to hack the makefile (a bit) and add the switch /MD
(or /MDd depending on build) when compiling Botan for use with IDE projects.


P/s Jack: IIRC I proposed a new structure for the makefile a while back -
I'll talk to you separately on that one.

> -----Original Message-----
> From: botan-devel-bounces at randombit.net [mailto:botan-devel-
> bounces at randombit.net] On Behalf Of Boris
> Sent: Tuesday, 25 September, 2007 5:17 AM
> To: botan-devel at randombit.net
> Subject: [Botan-devel] Linker errors in VS2005
> 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@@
> 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
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel

More information about the botan-devel mailing list