|
Boost : |
Subject: Re: [boost] [HELP] fatal error LNK1120: 5 unresolved externals
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2012-09-10 17:05:31
[Seow Hui, Saw]
> I installed boost 1.50 installer (32-bit) which downloaded from
> http://www.boostpro.com/download/ and did the appropriate settings
> (including CGAL) in Microsoft Visual Studio 2010.
> 1>libboost_system-vc100-mt-gd-1_50.lib(error_code.obj) : 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> >(class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &)"
> (??0?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QAE_at_ABV01@@Z)
> already defined in msvcprtd.lib(MSVCP90D.dll)
Somehow, you're mixing VC9 (VS 2008) and VC10 (VS 2010). You're linking to libboost_system-vc100-mt-gd-1_50.lib which has been built for VC10 (as indicated by "vc100"), and to the import lib (msvcprtd.lib) for MSVCP90D.dll which is VC9's (as indicated by "90"). VC's C++ Standard Library implementation forbids mixing different major versions like this, as we routinely break binary compatibility. This specific error is related to one of the changes between VC9 and VC10, when std::basic_string went from being DLL-exported to being header-only.
Stephan T. Lavavej
Visual C++ Libraries Developer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk