Xav*_*Tan 9 c++ compiler-errors boost-thread visual-c++ visual-c++-2010
我正在尝试编译我的程序但它根本不会链接.我已经指定了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)
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
更多信息:
我正在运行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
Run Code Online (Sandbox Code Playgroud)
谁能告诉我有什么问题?
更新:
在更改为增强1.51后,它排除了8个链接器错误中的7个,但这个仍然是持久的
error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z)
Run Code Online (Sandbox Code Playgroud)
我不知道这里发生了什么.这个来自boostpro 32位安装程序.它不能与我的源文件有关吗?
更新:
好的,我已经为boost 1.51解决了这个问题.在属性页>> C/C++ >>代码生成>>启用C++例外对我来说是关闭的.
好.我将尝试查看相同的设置是否解决了boost 1.52的问题.稍后会更新.
确保将正确的目录添加到链接器属性中。
阅读这篇文章以了解更多详细信息 Boost 链接器错误:无法解析的外部符号“class boost::system::error_category const & __cdecl boost::system::get_system_category(void)”
此外,您还必须将此路径添加到链接器添加目录中:
$(BOOST_ROOT)\bin.v2\libs\thread\build\msvc-xx.0\release\address-model-64\link-static\threading-multi
其中 xx 是您的 Visual Studio 版本
归档时间: |
|
查看次数: |
8113 次 |
最近记录: |