[regex VC 7.1] multiple symbols in link

Hi all, I'm looking into upgrading from Boost 1.32 to 1.33.1, but I have a problem with regex lib. When linking my application with the regex lib (I use automatic linking), I get multiple symbols linker error: libboost_regex-vc71-mt-gd-1_33_1.lib(usinstances.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<unsigned short>::length(unsigned short const *)" (?length@?$char_traits@G@std@@SAIPBG@Z) already defined in msvcprtd.lib(MSVCP71D.dll) libboost_regex-vc71-mt-gd-1_33_1.lib(usinstances.obj) : error LNK2005: "public: static bool __cdecl std::char_traits<unsigned short>::eq(unsigned short const &,unsigned short const &)" (?eq@?$char_traits@G@std@@SA_NABG0@Z) already defined in msvcprtd.lib(MSVCP71D.dll) With boost 1.32, everything works fine. In both 1.32 and 1.33.1, regex was built with bjam using VC 2003 compiler, default configuration (just ran bjam.exe "-sTOOLS=vc-7_1") STL library is the standard one, shipped with VS 2003. Any ideas? Thank you, -- Marko ICQ: 5990814 I'm not under the alkafluence of inkahol that some thinkle peep I am. It's just the drunker I sit here the longer I get.

Marko Bozikovic wrote:
Hi all,
I'm looking into upgrading from Boost 1.32 to 1.33.1, but I have a problem with regex lib. When linking my application with the regex lib (I use automatic linking), I get multiple symbols linker error:
Any ideas?
It's a known issue, although I haven't seen the char_traits::eq error before. It happens when you build as a Unicode app without specifying /Zc:wchar_t. Building with /Zc:wchar_t fixes the problem, as does building as a multi-byte app. Alternatively, add to the end of usinstances.cpp the code: #if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) template<> _CRTIMP2 std::size_t __cdecl char_traits<unsigned short>::length(unsigned short const*); #endif You may need a similar specialization for char_traits<>::eq as well. HTH, John.
participants (2)
-
John Maddock
-
Marko Bozikovic