Link problems with Beta2, STL & Boost

I'm trying to build my application with VS2005 Beta 2 and I'm having the following linking problems. I'm using Boost 1.32.0, which I've rebuilt with VS2005.
I've searched the docs but couldn't find any info on changes in the way STL libs are linked.
The errors are in 2 groups, "already defined" and unresolved external symbols.

Help!

Thanks,
Flavio.

1>Linking...

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std:Surpriseperator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &Wink" (?$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) already defined in libboost_serialization-vc71-mt-gd.lib(xml_oarchive.obj)

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std:Surpriseperator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (?$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z) already defined in libboost_serialization-vc71-mt-gd.lib(xml_oarchive.obj)

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std:Surpriseperator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &Wink" (?$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z) already defined in libboost_serialization-vc71-mt-gd.lib(xml_oarchive.obj)

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std:Surpriseperator+<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 &Wink" (?$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z) already defined in libboost_serialization-vc71-mt-gd.lib(xml_oarchive.obj)

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::allocator<char>::allocator<char>(void)" (?0?$allocator@D@std@@QAE@XZ) already defined in libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj)

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::allocator<char>::allocator<char>(class std::allocator<char> const &Wink" (?0?$allocator@D@std@@QAE@ABV01@@Z) already defined in libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj)

1>msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: unsigned int __thiscall std::allocator<char>::max_size(void)const " (?max_size@?$allocator@D@std@@QBEIXZ) already defined in libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj)

1> Creating library .\Debug\n-Track.lib and object .\Debug\n-Track.exp

1>libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj) : warning LNK4217: locally defined symbol ?_Addfac@_Locimp@locale@std@@AAEXPAVfacet@23@I@Z (private: void __thiscall std::locale::_Locimp::_Addfac(class std::locale::facet *,unsigned int)) imported in function "public: __thiscall std::locale::locale<class boost::archive::codecvt_null<char> >(class std::locale const &,class boost::archive::codecvt_null<char> *)" (?$?0V?$codecvt_null@D@archive@boost@@@locale@std@@QAE@ABV01@PAV?$codecvt_null@D@archive@boost@@@Z)

1>libboost_serialization-vc71-mt-gd.lib(basic_text_iprimitive.obj) : warning LNK4049: locally defined symbol ?_Addfac@_Locimp@locale@std@@AAEXPAVfacet@23@I@Z (private: void __thiscall std::locale::_Locimp::_Addfac(class std::locale::facet *,unsigned int)) imported

1>libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj) : warning LNK4217: locally defined symbol ?0_Locimp@locale@std@@AAE@ABV012@@Z (private: __thiscall std::locale::_Locimp::_Locimp(class std::locale::_Locimp const &Wink) imported in function "public: __thiscall std::locale::locale<class boost::archive::codecvt_null<char> >(class std::locale const &,class boost::archive::codecvt_null<char> *)" (?$?0V?$codecvt_null@D@archive@boost@@@locale@std@@QAE@ABV01@PAV?$codecvt_null@D@archive@boost@@@Z)

1>libboost_serialization-vc71-mt-gd.lib(basic_text_iprimitive.obj) : warning LNK4049: locally defined symbol ?0_Locimp@locale@std@@AAE@ABV012@@Z (private: __thiscall std::locale::_Locimp::_Locimp(class std::locale::_Locimp const &Wink) imported

1>direct_show.obj : error LNK2019: unresolved external symbol "int __stdcall lstrlenWInternal(wchar_t const *)" (?lstrlenWInternal@@YGHPB_W@Z) referenced in function "protected: virtual struct HWND__ * __thiscall PluginInstanceDirectX:Stick out tongueropertiesCreate(struct HWND__ *,bool)" (?PropertiesCreate@PluginInstanceDirectX@@MAEPAUHWND__@@PAU2@_N@Z)

1>libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj) : error LNK2019: unresolved external symbol __imp_?_Xran@_String_base@std@@QBEXXZ referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::_DebugHeapAllocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::_DebugHeapAllocator<char> >::assign(class std::basic_string<char,struct std::char_traits<char>,class std::_DebugHeapAllocator<char> > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$_DebugHeapAllocator@D@2@@std@@QAEAAV12@ABV12@II@Z)

1>libboost_serialization-vc71-mt-gd.lib(basic_text_iprimitive.obj) : error LNK2001: unresolved external symbol __imp_?_Xran@_String_base@std@@QBEXXZ

1>libboost_serialization-vc71-mt-gd.lib(basic_text_oprimitive.obj) : error LNK2019: unresolved external symbol __imp_?_Xlen@_String_base@std@@QBEXXZ referenced in function "protected: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::_DebugHeapAllocator<char> >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$_DebugHeapAllocator@D@2@@std@@IAE_NI_N@Z)

1>libboost_serialization-vc71-mt-gd.lib(basic_text_iprimitive.obj) : error LNK2001: unresolved external symbol __imp_?_Xlen@_String_base@std@@QBEXXZ

1>libboost_serialization-vc71-mt-gd.lib(xml_iarchive.obj) : error LNK2019: unresolved external symbol __imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AViterator@12@XZ referenced in function "protected: void __thiscall boost::archive::basic_xml_iarchive<class boost::archive::xml_iarchive>::load_end(char const *)" (?load_end@?$basic_xml_iarchive@Vxml_iarchive@archive@boost@@@archive@boost@@IAEXPBD@Z)

1>libboost_serialization-vc71-mt-gd.lib(xml_grammar.obj) : error LNK2001: unresolved external symbol __imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AViterator@12@XZ

1>libboost_serialization-vc71-mt-gd.lib(xml_iarchive.obj) : error LNK2019: unresolved external symbol __imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AViterator@12@XZ referenced in function "protected: void __thiscall boost::archive::basic_xml_iarchive<class boost::archive::xml_iarchive>::load_end(char const *)" (?load_end@?$basic_xml_iarchive@Vxml_iarchive@archive@boost@@@archive@boost@@IAEXPBD@Z)

1>libboost_serialization-vc71-mt-gd.lib(xml_grammar.obj) : error LNK2001: unresolved external symbol __imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AViterator@12@XZ

1>libboost_serialization-vc71-mt-gd.lib(xml_grammar.obj) : error LNK2019: unresolved external symbol __imp_?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@Vconst_iterator@12@0@Z referenced in function "public: void __thiscall boost::archive::`anonymous namespace'::append_string<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator>:Surpriseperator()(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator)const " (?R?$append_string@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Vconst_iterator@12@@?A0x6748d6fd@archive@boost@@QBEXVconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z)

1>strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)

1>strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)

[10818 byte] By [Flap] at [2008-3-3]
# 1
This is really more of a boost question.

It looks like you built boost using the VC-7_1 toolset definition. Current boost CVS supports a VC-8 toolset as well, you might want to try that in case there was an options change that's relevant (I don't recall if the VC-8 toolset is in boost 1.32, but it might be).

CarlDaniel at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...
# 2
I think I've build Boost with the VC-8_0 toolset, even though the libs have the 7_1 suffix. The build of the Boost libs goes without an hitch (not even the deprecated functions warnings), but then I get the link errors.
Flap at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...
# 3
Hi,

This looks like you are mixing /MT and /MD. Your application is built with /MD, when boost library is built with /MT. Please double check how you link to CRT in both projects and choose one consistent way.

Thanks,
Nikola Dudar
Visual C++ Team

NikolaDudar at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...