带有Boost Regex库的未解决的外部对象
Unresolved external objects with boost regex library
我刚刚开始学习C ,现在我尝试使用Boost库。顺便说一句,我正在使用Visual Studio 2015 Professional。
我已经下载了文件 BOOST_1_1_5_0-BIN-MSVC-ALL-32-64.7Z ,并遵循本教程中的说明。但是当我尝试编译时,我会遇到错误:
1>libboost_regex-vc120-mt-gd-1_55.liberror LNK2019: external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &)" (__imp_??0exception@std@@QAE@ABQBD@Z) sin resolver al que se hace referencia en la función "public: __thiscall std::logic_error::logic_error(char const *)" (??0logic_error@std@@QAE@PBD@Z)
1>libboost_regex-vc120-mt-gd-1_55.lib(regex.obj) : error LNK2001: external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &)" (__imp_??0exception@std@@QAE@ABQBD@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(w32_regex_traits.obj) : error LNK2001: external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &)" (__imp_??0exception@std@@QAE@ABQBD@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(instances.obj) : error LNK2019: external symbol "__declspec(dllimport) public: struct std::_Iterator_base12 * * __thiscall std::_Container_base12::_Getpfirst(void)const " (__imp_?_Getpfirst@_Container_base12@std@@QBEPAPAU_Iterator_base12@2@XZ) sin resolver al que se hace referencia en la función "protected: void __thiscall std::_Tree<class std::_Tmap_traits<int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<int>,class std::allocator<struct std::pair<int const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> >::_Orphan_ptr(class std::_Tree<class std::_Tmap_traits<int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<int>,class std::allocator<struct std::pair<int const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> > &,struct std::_Tree_node<struct std::pair<int const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,void *> *)const " (?_Orphan_ptr@?$_Tree@V?$_Tmap_traits@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@H@2@V?$allocator@U?$pair@$$CBHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$0A@@std@@@std@@IBEXAAV12@PAU?$_Tree_node@U?$pair@$$CBHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@PAX@2@@Z)
1>libboost_regex-vc120-mt-gd-1_55.lib(instances.obj) : error LNK2019: external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base12::_Swap_all(struct std::_Container_base12 &)" (__imp_?_Swap_all@_Container_base12@std@@QAEXAAU12@@Z) sin resolver al que se hace referencia en la función "public: void __thiscall std::vector<struct boost::sub_match<char const *>,class std::allocator<struct boost::sub_match<char const *> > >::swap(class std::vector<struct boost::sub_match<char const *>,class std::allocator<struct boost::sub_match<char const *> > > &)" (?swap@?$vector@U?$sub_match@PBD@boost@@V?$allocator@U?$sub_match@PBD@boost@@@std@@@std@@QAEXAAV12@@Z)
1>libboost_regex-vc120-mt-gd-1_55.lib(regex_raw_buffer.obj) : error LNK2001: external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPBDH@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(instances.obj) : error LNK2001: external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPBDH@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(regex.obj) : error LNK2001: external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPBDH@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(regex_traits_defaults.obj) : error LNK2001: external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPBDH@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(w32_regex_traits.obj) : error LNK2001: external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPBDH@Z) sin resolver
1>libboost_regex-vc120-mt-gd-1_55.lib(w32_regex_traits.obj) : error LNK2019: external symbol "__declspec(dllimport) public: bool __thiscall type_info::operator==(class type_info const &)const " (__imp_??8type_info@@QBE_NABV0@@Z) sin resolver al que se hace referencia en la función "public: virtual void * __thiscall boost::detail::sp_counted_impl_pd<struct HINSTANCE__ *,void (__cdecl*)(void *)>::get_deleter(class type_info const &)" (?get_deleter@?$sp_counted_impl_pd@PAUHINSTANCE__@@P6AXPAX@Z@detail@boost@@UAEPAXABVtype_info@@@Z)
1>D:FuentesCPPConsoleReadDirDebugConsoleReadDir.exe : fatal error LNK1120: 5 unresolved external
我已经更新了其他库目录路径: D:Descargasboost_1_55_0-bin-msvc-all-32-64boost_1_55_0lib32-msvc-12.0
。
我需要做什么才能添加外部对象?
这是因为您的构建版本的Boost版本早于Visual Studio 2015,请参见如何指定,哪个版本的Boost库链接到?
?当前版本的Boost,1.62
工作正常。如果找不到预先构建的二进制文件,那么可以很容易地使用MSVC构建Windows库,请参见:Boost安装Windows
相关文章:
- 节俭并发:未解决的外部问题
- 未解决的外部链接问题
- Visual Studio 2017 中的 QtMetaObject 未解决的外部错误
- 在Embarcadero C++ Builder中生成的DLL未解决的外部链接错误
- 解释未解决的外部C++
- 矛盾的未解决的外部符号+未使用的库与VS2017和FFMPEG 4
- 队列未添加对象-C++11
- 函数路径追加上未解决的外部符号错误
- Lapack函数DGTSV通过C /Visual Studio提供未解决的外部符号
- 类型长的长度和未解决的超载函数类型的类型的操作数与二进制运算符
- 运算符过载上未解决的外部符号
- 尝试使用堆栈简化目录路径时出现未解决的分段错误
- 指向未由对象地址初始化的对象的指针如何将值分配给类的数据成员
- qfilesystemwatcher未解决的外部
- C 未解决的外部符号(公共静态INT)
- 单一实例对象的未解决外部符号链接错误
- 使用QT5上的对象指针上使用QRegisterMetate类型会引发未解决的错误
- 带有Boost Regex库的未解决的外部对象
- 通过使用新操作员创建对象会导致未解决的外部符号错误C FTGL
- c++错误:如何解决对象的malloc: ***错误.未分配被释放的指针