0

I've changed the 'Runtime Library' setting of my project in the release configuration to 'Multi-threaded (/MT)' (it was 'Multi-threaded DLL (/MD)' before) to get rid of the dependencies to the msvc*-libraries.

I've build boost using bjam with the options '--prefix=boost_build variant=release link=static runtime-link=static threading=multi runtime-debugging=off', which seems to generate the correct libraries. ('libboost_system-vc120-mt-s-1_55.lib')

However, trying to link with them results in these linker errors:

1>Tags.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z)
1>libboost_system-vc120-mt-s-1_55.lib(error_code.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z)
1>libboost_thread-vc120-mt-s-1_55.lib(thread.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z)
1>Tags.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ)
1>libboost_system-vc120-mt-s-1_55.lib(error_code.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ)
1>libboost_thread-vc120-mt-s-1_55.lib(thread.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ)
1>3ds.obj : error LNK2001: unresolved external symbol "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ)
1>3ds.obj : error LNK2001: unresolved external symbol "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z)
1>3ds.obj : error LNK2001: unresolved external symbol __Getctype
1>3ds.obj : error LNK2001: unresolved external symbol __Getcvt
1>3ds.obj : error LNK2001: unresolved external symbol "private: static int std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@std@@0HA)
1>3ds.obj : error LNK2001: unresolved external symbol "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" (?_Init@locale@std@@CAPAV_Locimp@12@_N@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ)
1>3ds.obj : error LNK2001: unresolved external symbol __Tolower
1>3ds.obj : error LNK2001: unresolved external symbol __Toupper
1>3ds.obj : error LNK2001: unresolved external symbol "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPBDH@Z)
1>libboost_system-vc120-mt-s-1_55.lib(error_code.obj) : error LNK2001: unresolved external symbol "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPBDH@Z)
1>libboost_thread-vc120-mt-s-1_55.lib(thread.obj) : error LNK2001: unresolved external symbol "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPBDH@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "char const * __cdecl std::_Winerror_map(int)" (?_Winerror_map@std@@YAPBDH@Z)
1>libboost_system-vc120-mt-s-1_55.lib(error_code.obj) : error LNK2001: unresolved external symbol "char const * __cdecl std::_Winerror_map(int)" (?_Winerror_map@std@@YAPBDH@Z)
1>libboost_thread-vc120-mt-s-1_55.lib(thread.obj) : error LNK2001: unresolved external symbol "char const * __cdecl std::_Winerror_map(int)" (?_Winerror_map@std@@YAPBDH@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z)
1>libboost_system-vc120-mt-s-1_55.lib(error_code.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z)
1>libboost_thread-vc120-mt-s-1_55.lib(thread.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > std::cout" (?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)
1>3ds.obj : error LNK2001: unresolved external symbol "__int64 const std::_BADOFF" (?_BADOFF@std@@3_JB)
1>3ds.obj : error LNK2001: unresolved external symbol "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPAV12@@Z)
1>3ds.obj : error LNK2001: unresolved external symbol "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ)
1>3ds.obj : error LNK2001: unresolved external symbol "public: static class std::locale::id std::ctype<char>::id" (?id@?$ctype@D@std@@2V0locale@2@A)
1>3ds.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Facet_Register(class std::_Facet_base *)" (?_Facet_Register@std@@YAXPAV_Facet_base@1@@Z)
1>C:\Users\****\Desktop\shared\Visual Studio Projects\weave\Release\shared.dll : fatal error LNK1120: 23 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I've seen various posts here with similar issues, but it always turned out it was due to different compiler settings.

The settings are the same in my case, so what's going on?

Silverlan
  • 2,783
  • 3
  • 31
  • 66
  • 2
    These identifiers come from the static CRT link libraries, libcmt.lib and libcpmt.lib. Intentionally not linking those takes a fair amount of effort, avoid /NODEFAULTLIB. – Hans Passant Jan 07 '14 at 13:09
  • My apologies, you're right. I still had '/NODEFAULTLIB:libcpmt' in the options, removing it resolved the issues. Thanks. – Silverlan Jan 07 '14 at 14:23

0 Answers0