内容简介:翻译自:https://stackoverflow.com/questions/14674374/trying-to-link-boost-1-52-thread
我正在尝试编译我的程序但它根本不会链接.我已经指定了boost lib文件的路径,链接器仍然抱怨.这是我得到的链接错误:
1>Edproj.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) 1>Edproj.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ) 1>Edproj.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_base@detail@boost@@UAE@XZ) 1>Edproj.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z) 1>Edproj.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::detach(void)" (?detach@thread@boost@@QAEXXZ) 1>Edproj.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::join(void)" (?join@thread@boost@@QAEXXZ) 1>Edproj.obj : error LNK2001: unresolved external symbol "private: void __thiscall boost::thread::start_thread(void)" (?start_thread@thread@boost@@AAEXXZ) 1>Edproj.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::this_thread::interruptible_wait(void *,struct boost::detail::timeout)" (?interruptible_wait@this_thread@boost@@YA_NPAXUtimeout@detail@2@@Z)
BOOST_LIB_DIAGNOSTIC返回
1> Linking to lib file: libboost_thread-vc100-mt-s-1_52.lib 1> Linking to lib file: libboost_date_time-vc100-mt-s-1_52.lib 1> Linking to lib file: libboost_system-vc100-mt-s-1_52.lib 1> Linking to lib file: libboost_chrono-vc100-mt-s-1_52.lib
更多信息:
我正在运行64位Windows 8 Pro,并使用以下选项编译了boost
bjam --build-type=complete --toolset=msvc10.0 address-model=64 architecture=x86 variant=debug,release threading=multi link=static runtime-link=static
谁能告诉我有什么问题?
更新:
在更改为增强1.51后,它排除了8个链接器错误中的7个,但这个仍然是持久的
error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z)
我不知道这里发生了什么.这个来自boostpro 32位安装程序.它不能与我的源文件有关吗?
更新:
好的,我已经为boost 1.51解决了这个问题.在物业页>>中结果C/C++>>代码生成>>启用C Exceptions对我来说已关闭.
好.我将尝试查看相同的设置是否解决了boost 1.52的问题.稍后会更新.
我之前遇到过同样的问题:我使用默认参数构建boost lib,直接运行bootstrap.bat.
如果你在项目中使用boost :: system,你应该使用并指定x86或x64版本的boost :: system lib.
您可以使用此bat重新编译boost lib,保存这些以提升根文件夹并在CMD窗口中运行它(不要双击!):
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86 cd boost_1_60_0 call bootstrap.bat rem Most libraries can be static libs b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64 b2 -j8 toolset=msvc-14.0 address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/win32 pause
翻译自:https://stackoverflow.com/questions/14674374/trying-to-link-boost-1-52-thread
以上所述就是小编给大家介绍的《c – 尝试链接Boost 1.52线程》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
JavaScript语言精粹
Douglas Crockford / 赵泽欣、鄢学鹍 / 电子工业出版社 / 2009-4 / 35.00元
本书通过对JavaScript语言的分析,甄别出好的和坏的特性,从而提取出相对这门语言的整体而言具有更好的可靠性、可读性和可维护性的JavaScript的子集,以便你能用它创建真正可扩展的和高效的代码。 雅虎资深JavaScript架构师Douglas Crockford倾力之作。 向读者介绍如何运用JavaScript创建真正可扩展的和高效的代码。一起来看看 《JavaScript语言精粹》 这本书的介绍吧!