B
Bruno van Dooren
Hi,
i am using a third party static library (.lib) that wraps a class interface
around an old C-style dll. in the static library they use the STL for some
stuff i don't know about.
in my own code, i also use the STL, for basic_string for example.
at link time, i get a lot of errors like:
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?$allocator@D@2@@std@@QAE@XZ)
already defined in ErrorHandling.obj
ErrorHandling.obj is the object file for the source file that contains my
errorhandling code. There is some basic_string stuff in there.
i can work around this by using /FORCE:MULTIPLE but this looks inelegant and
also gives lots of warnings. another way is to set project C++ options for
using runtime libraries in a dll instead of static. this works but i guess
this will only work if i don't have to link against multiple statis libs
that use the same functionality.
is there a better way to handle this problem?
kind regards and happy newyear to all of you,
Bruno.
i am using a third party static library (.lib) that wraps a class interface
around an old C-style dll. in the static library they use the STL for some
stuff i don't know about.
in my own code, i also use the STL, for basic_string for example.
at link time, i get a lot of errors like:
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?$allocator@D@2@@std@@QAE@XZ)
already defined in ErrorHandling.obj
ErrorHandling.obj is the object file for the source file that contains my
errorhandling code. There is some basic_string stuff in there.
i can work around this by using /FORCE:MULTIPLE but this looks inelegant and
also gives lots of warnings. another way is to set project C++ options for
using runtime libraries in a dll instead of static. this works but i guess
this will only work if i don't have to link against multiple statis libs
that use the same functionality.
is there a better way to handle this problem?
kind regards and happy newyear to all of you,
Bruno.