I'm using Boost 1.54 and Qt 5.3.2 in Visual Studio 2010. I'm trying to use the static libs of Boost Filesystem. However, whenever I try to build my application, I get the following linking errors:
libboost_filesystem-mt.lib(path.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::codecvt<wchar_t,char,int>::codecvt<wchar_t,char,int>(unsigned int)" (__imp_??0?$codecvt@_WDH@std@@QAE@I@Z)
libboost_filesystem-mt.lib(path.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __thiscall std::locale::_Locimp::_Locimp(class std::locale::_Locimp const &)" (__imp_??0_Locimp@locale@std@@AAE@ABV012@@Z)
libboost_filesystem-mt.lib(path_traits.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::codecvt<wchar_t,char,int>::in(int &,char const *,char const *,char const * &,wchar_t *,wchar_t *,wchar_t * &)const " (__imp_?in@?$codecvt@_WDH@std@@QBEHAAHPBD1AAPBDPA_W3AAPA_W@Z)
libboost_filesystem-mt.lib(path_traits.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::codecvt<wchar_t,char,int>::out(int &,wchar_t const *,wchar_t const *,wchar_t const * &,char *,char *,char * &)const " (__imp_?out@?$codecvt@_WDH@std@@QBEHAAHPB_W1AAPB_WPAD3AAPAD@Z)
Here are some additional information about my project settings, which may be of help:
BOOST_ALL_NO_LIBin Configuration Properties > C/C++ > Preprocessor > Preprocessor DefinitionsMulti-threaded (/MT)in Configuration Properties > C/C++ > Code Generation > Runtime Librarylibboost_filesystem-mt.libandlibboost_system-mt.libin Configuration Properties > Linker > Input > Additional Dependencies..\Libraries\1.54.0\lib_win32(Boost library folder) in Configuration Properties > Linker > General > Additional Library Directoriesmsvcrt.libandmsvcprt.libin Configuration Properties > Linker > Input > Ignore Specific Default Libraries
What could be the problem? I have read on the Internet that Boost does not work very well with Qt. Could that be the problem?
msvcrt.lib and msvcprt.lib in Configuration Properties > Linker > Input > Ignore Specific Default LibrariesA lot of times this is a sign of a problem. Make sure Qt and boost were both built with the Visual Studio 2010 and you used the same CRT. - drescherjmmsvcrt.dllit is the static crt, otherwise it is a dynamic crt. For vs2010 it is namedmsvcr100.dll. - UmNyobe