<small id='h2se1'></small><noframes id='h2se1'>

    <i id='h2se1'><tr id='h2se1'><dt id='h2se1'><q id='h2se1'><span id='h2se1'><b id='h2se1'><form id='h2se1'><ins id='h2se1'></ins><ul id='h2se1'></ul><sub id='h2se1'></sub></form><legend id='h2se1'></legend><bdo id='h2se1'><pre id='h2se1'><center id='h2se1'></center></pre></bdo></b><th id='h2se1'></th></span></q></dt></tr></i><div id='h2se1'><tfoot id='h2se1'></tfoot><dl id='h2se1'><fieldset id='h2se1'></fieldset></dl></div>
    • <bdo id='h2se1'></bdo><ul id='h2se1'></ul>
      <tfoot id='h2se1'></tfoot>
      <legend id='h2se1'><style id='h2se1'><dir id='h2se1'><q id='h2se1'></q></dir></style></legend>
    1. 尝试链接 Boost 1.52 线程

      时间:2023-10-05
      <legend id='W1kyo'><style id='W1kyo'><dir id='W1kyo'><q id='W1kyo'></q></dir></style></legend>
      <tfoot id='W1kyo'></tfoot>

          <tbody id='W1kyo'></tbody>
        • <bdo id='W1kyo'></bdo><ul id='W1kyo'></ul>

          <small id='W1kyo'></small><noframes id='W1kyo'>

        • <i id='W1kyo'><tr id='W1kyo'><dt id='W1kyo'><q id='W1kyo'><span id='W1kyo'><b id='W1kyo'><form id='W1kyo'><ins id='W1kyo'></ins><ul id='W1kyo'></ul><sub id='W1kyo'></sub></form><legend id='W1kyo'></legend><bdo id='W1kyo'><pre id='W1kyo'><center id='W1kyo'></center></pre></bdo></b><th id='W1kyo'></th></span></q></dt></tr></i><div id='W1kyo'><tfoot id='W1kyo'></tfoot><dl id='W1kyo'><fieldset id='W1kyo'></fieldset></dl></div>

              • 本文介绍了尝试链接 Boost 1.52 线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在尝试编译我的程序,但它根本无法链接.我已经指定了 boost lib 文件的路径,但链接器仍然抱怨.这是我得到的链接错误:

                I am trying to compile my program but it wouldn't link at all. I have specified the path to the boost lib files and the linker still complain. Here's the linking error I got:

                1>Edproj.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_categoryboost@@YAABVerror_categoryXZ)
                1>Edproj.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_categoryboost@@YAABVerror_categoryXZ)
                1>Edproj.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_baseboost@@UAE@XZ)
                1>Edproj.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@YAXABVexception@@Z)
                1>Edproj.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::detach(void)" (?detachboost@@QAEXXZ)
                1>Edproj.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::join(void)" (?joinboost@@QAEXXZ)
                1>Edproj.obj : error LNK2001: unresolved external symbol "private: void __thiscall boost::thread::start_thread(void)" (?start_threadboost@@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@YA_NPAXUtimeout2@@Z)
                

                BOOST_LIB_DIAGNOSTIC 返回

                BOOST_LIB_DIAGNOSTIC returns

                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

                I am running a 64-bit Windows 8 Pro and I compiled boost with the following option

                bjam --build-type=complete --toolset=msvc10.0 address-model=64 architecture=x86 variant=debug,release threading=multi link=static runtime-link=static
                

                谁能告诉我哪里出了问题?

                Can someone tell me what is wrong?

                更新:

                更改为 boost 1.51 后,它消除了 8 个链接器错误中的 7 个,但这个错误仍然存​​在

                After changing to boost 1.51 it got rid 7 out of 8 of those linker errors but this one is still persistent

                error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@YAXABVexception@@Z)
                

                我不明白这里发生了什么.这是来自 boostpro 32 位安装程序.应该和我的源文件没有关系吧?

                I don't get what is going on here. This one is from boostpro 32 bit installer. It couldn't have something to do with my source file right?

                更新:

                好的,我已经为 boost 1.51 解决了这个问题.结果在属性页 >> C/C++ >> 代码生成 >> 启用 C++ 异常对我来说是关闭的.

                Ok I have solved this problem for boost 1.51. Turns out in the Property Pages >> C/C++ >> Code Generation >> Enable C++ Exceptions was turn off for me.

                好的.我将尝试查看相同的设置是否可以解决 boost 1.52 的问题.稍后更新.

                OK. I will attempt to see if the same settings solve the problem for boost 1.52. Will update later.

                推荐答案

                我之前也遇到过同样的问题:我使用默认参数构建 boost lib,这些参数直接运行 bootstrap.bat.

                I had the same problem before: I build boost lib with default parameters which run bootstrap.bat directly.

                如果你在你的项目中使用了boost::system,你应该使用并指定 x86 或 x64 版本的 boost::system 库.

                if you use boost::system in your project, you should use and appoint x86 or x64 version of boost::system lib.

                你可以用这个bat重新编译boost lib,将它们保存到boost根文件夹并在CMD窗口中运行它(不要双击!):

                you can recompile boost lib with this bat, save these to boost root folder and run it in CMD windows(don't double click!):

                call "%VS140COMNTOOLS%....VCvcvarsall.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://studiofreya.com/2015/12/19/how-to-build-boost-1-60-with-visual-studio-2015/

                for more details you can see this article: https://studiofreya.com/2015/12/19/how-to-build-boost-1-60-with-visual-studio-2015/

                这篇关于尝试链接 Boost 1.52 线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:IsBadReadPtr 的最有效替代品? 下一篇:如何在内部函数中使用 if 条件

                相关文章

                最新文章

                    <tfoot id='bHsQT'></tfoot>
                  1. <legend id='bHsQT'><style id='bHsQT'><dir id='bHsQT'><q id='bHsQT'></q></dir></style></legend>

                    <small id='bHsQT'></small><noframes id='bHsQT'>

                      <bdo id='bHsQT'></bdo><ul id='bHsQT'></ul>
                    <i id='bHsQT'><tr id='bHsQT'><dt id='bHsQT'><q id='bHsQT'><span id='bHsQT'><b id='bHsQT'><form id='bHsQT'><ins id='bHsQT'></ins><ul id='bHsQT'></ul><sub id='bHsQT'></sub></form><legend id='bHsQT'></legend><bdo id='bHsQT'><pre id='bHsQT'><center id='bHsQT'></center></pre></bdo></b><th id='bHsQT'></th></span></q></dt></tr></i><div id='bHsQT'><tfoot id='bHsQT'></tfoot><dl id='bHsQT'><fieldset id='bHsQT'></fieldset></dl></div>