3

I am using boost 1_53 libraries with VS10.
I am getting many unresolved symbols during linking. like the following:

error LNK2019: unresolved external symbol "void __cdecl boost_1_53_0::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &,class std::codecvt<unsigned short,char,int> const &)" (?convert@path_traits@filesystem@boost_1_53_0@@YAXPEBD0AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEBV?$codecvt@GDH@5@@Z) referenced in function "void __cdecl boost_1_53_0::filesystem::path_traits::convert(char const *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &,class std::codecvt<unsigned short,char,int> const &)" (?convert@path_traits@filesystem@boost_1_53_0@@YAXPEBDAEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEBV?$codecvt@GDH@5@@Z)

I checked /LIBPATH is set correctly also "boost_1_53_0_filesystem-mt.lib" is coming in link line.
i used dumpbin to find symbol in "lib" its coming like:

00000036  REL32 00000000 515  ?convert@path_traits@filesystem@boost_1_53_0@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDH@5@@Z (void __cdecl boost_1_53_0::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,int> const &))

Is this parameter change causing issue?

EDIT:
I like to add more details:
Previously i was using boost 1_48 which was working fine. I found that in boost 1_48 symbols under path_traits ends with @GDH@5@@Z whicle in boost 1_53 its ending with @_WDH@5@@Z
But still It trying to search synbol end with @GDH@5@@Z
This can cause error?
If so why its taking that symbols?

Abhi
  • 192
  • 1
  • 4
  • 17

3 Answers3

0

Unless you've built every possible permutation of the Boost libraries, it is necessary to make sure that your compiler settings match the settings used to build Boost.

The relevant settings are:

  • debug vs. release
  • statically linked runtime vs. DLL
  • single-threaded vs. multi-threaded

The name boost_1_53_0_filesystem-mt.lib implies that the Boost libraries were built release mode, multi-threaded, DLL runtime.

Is that how you're building your project?

Ferruccio
  • 98,941
  • 38
  • 226
  • 299
  • Thx for support. i build boost 1_48 that time it works fine problem started with same code once i started using boost 1_53 i build boost 1_53 same way i built boost 1_48 I hv edited question with more details – Abhi Jul 22 '13 at 11:04
0

Right click on ->properties ->in general tab check whether

Common Language Runtime support = "No Common Language Runtime support"

-> in c/C++ -> code generation check whether

Runtime library Multi-threaded DLL (/MD)

finally in the menu bar go to -> tools -> options -> project and solutions -> VC++ directories -> library files check whether you have given the complete path where you boost librarus are usually

"\boost_1_53\stage\lib"

NOTE: the setting paths are mentioned for VS2008

Navin
  • 554
  • 2
  • 9
  • 31
  • Thx for support. I checked settings it looks fine – Abhi Jul 22 '13 at 11:05
  • @Abhi so did u figure it out or the u still stuck ? – Navin Jul 23 '13 at 10:39
  • oh wait i noticed that you have build the boost as Multi-threaded so did u try changing the Runtime library to Multi-threaded (/MT) ? – Navin Jul 23 '13 at 10:42
  • 1
    thx for support i finally got what the problem is actually its causing due to QT (I never thought so) i build boost with /Zc:wchar_t flag while the QT is buils with /Zc:wchar_t- which causing error – Abhi Aug 02 '13 at 11:10
0

You can check if you are not using 64 bit compiled boost libraries instead of 32 bit ones (and vice versa). It's what happened for me while using boost::filesystem.

Juicebox
  • 442
  • 4
  • 11