
Hi all! I have an application which uses STLport 5.0.0, libtorrent (which in turn uses Boost). What I have done is that I have compiled the boost libraries for msvc7.1-stlport. I only uses three, i.e. filesystem, date_time and thread. My boost version is 1.33.1 So the problem occurs when my application is linking. Then I get a lot of LNK2005 link errors. I have no problems with compiling my code and use the boost libraries it's only when I'm about to link it fails. The errors says, in general, that a lot of things already are defined in libboost_xxx_mt-sp... I guess that if I post some of my errors it will be easier for those who wants to help me :) So here we go... 1. msvcprtd.lib(MSVCP71D.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+=(char const *)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in libboost_filesystem-vc71-mt-sp-1_33_1.lib(path_posix_windows.obj) 2. msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > & __thiscall std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@II@Z) already defined in libboost_date_time-vc71-mt-sp-1_33_1.lib(greg_month.obj) 3. msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::widen(char)const " (?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z) already defined in libboost_thread-vc71-mt-sp-1_33_1.lib(once.obj) 4. msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in libboost_thread-vc71-mt-sp-1_33_1.lib(once.obj) I would really appreciate if anyone could help me out here. Since I am new to C++ etc. I have major difficulties in intepreting the error messages. Best regards Marcus Krantz

I'm not sure if my suggestions are any helpful, but are you sure that you use only one runtime lib? In Windows it is very important that you define always the same runtime lib in all of your modules ( libs ). Do you set the boost libs yourselfs in the project settings? Or do you use the autolink feature? Greets, Christian
participants (2)
-
Christian Henning
-
Marcus Krantz