[Botan-devel] Linking problem Botan 1.8.0 + VC2008

cubeltd at poczta.fm cubeltd at poczta.fm
Tue Jan 20 09:48:59 EST 2009


Hi,
I'm new user of Botan library. I%u2019ve tried to use this library under MS Visual C++ Express Edition 2008. I%u2019ve tried just start so the whole %u201Cprogram%u201D looks like below:

// botan_test_1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <botan/botan.h>



int _tmain(int argc, _TCHAR* argv[])
{
	Botan::LibraryInitializer init;
	return 0;
}
 
I encounter problems during linking:

1>Linking...
1>msvcprtd.lib(MSVCP90D.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(init.obj)
1>msvcprtd.lib(MSVCP90D.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 at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at PBD@Z) already defined in libbotan.lib(init.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QBEPBDXZ) already defined in libbotan.lib(init.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAEAAV01 at ABV01@@Z) already defined in libbotan.lib(init.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?HDU?$char_traits at D@std@@V?$allocator at D@1@@std@@YA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@0 at PBDABV10@@Z) already defined in libbotan.lib(init.obj)

I guess it%u2019s problem with configuration of linker option but I%u2019m not able to find correct configuration. Could you give me any hints or instruction how should it be configured?

Moreover during compilation I see a lot of warnings such:
Compiling...
1>botan_test_1.cpp
1>c:\botan\botan\exceptn.h(19) : warning C4275: non dll-interface class 'std::exception' used as base for dll-interface class 'Botan::Exception'
1>        c:\program files\microsoft visual studio 9.0\vc\include\exception(95) : see declaration of 'std::exception'
1>        c:\botan\botan\exceptn.h(18) : see declaration of 'Botan::Exception'
1>c:\botan\botan\exceptn.h(27) : warning C4251: 'Botan::Exception::msg' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'Botan::Exception'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>c:\botan\botan\symkey.h(41) : warning C4251: 'Botan::OctetString::bits' : class 'Botan::SecureVector<T>' needs to have dll-interface to be used by clients of class 'Botan::OctetString'
1>        with
1>        [
1>            T=Botan::byte
1>        ]
%u2026

What can be done to avoid such wornigs?

Best regards,
Woockash



----------------------------------------------------------------------
Sprawdz, co wyswietlaja kina w Twoim miescie!
http://link.interia.pl/f2028




More information about the botan-devel mailing list