<tfoot id='ZwEiN'></tfoot>

    • <bdo id='ZwEiN'></bdo><ul id='ZwEiN'></ul>

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

      <i id='ZwEiN'><tr id='ZwEiN'><dt id='ZwEiN'><q id='ZwEiN'><span id='ZwEiN'><b id='ZwEiN'><form id='ZwEiN'><ins id='ZwEiN'></ins><ul id='ZwEiN'></ul><sub id='ZwEiN'></sub></form><legend id='ZwEiN'></legend><bdo id='ZwEiN'><pre id='ZwEiN'><center id='ZwEiN'></center></pre></bdo></b><th id='ZwEiN'></th></span></q></dt></tr></i><div id='ZwEiN'><tfoot id='ZwEiN'></tfoot><dl id='ZwEiN'><fieldset id='ZwEiN'></fieldset></dl></div>
      <legend id='ZwEiN'><style id='ZwEiN'><dir id='ZwEiN'><q id='ZwEiN'></q></dir></style></legend>
      1. 发布模式下的 Regex Boost 库链接警告“重复部分的大小不同"使用 mingw-w64 工具链时

        时间:2023-07-18
          <bdo id='aeUVQ'></bdo><ul id='aeUVQ'></ul>
        • <tfoot id='aeUVQ'></tfoot>

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

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

                  本文介绍了发布模式下的 Regex Boost 库链接警告“重复部分的大小不同"使用 mingw-w64 工具链时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在发布模式下链接我的项目时,我收到以下警告:

                  When linking my project in the release mode I am getting the following warning:

                  myProject-libs/release/libboost_regex-mt-s-1.50.0.a(cpp_regex_traits.o): duplicate section `.data$_ZZN5boost16cpp_regex_traitsIcE21get_catalog_name_instEvE6s_name[boost::cpp_regex_traits<char>::get_catalog_name_inst()::s_name]' has different size
                  

                  我怀疑原因可能是 boost 库的编译选项与我在项目中使用的选项不同,但我不知道如何找到差异(boost 在构建过程中没有输出这些选项).

                  I suspect that the cause could be that the boost library is compiled with different options than I use for my project, but I don't know how to find the difference (boost didn't output these options during the build).

                  为了在 Ubuntu 12.04 上为 win32 编译 boost 我使用了这个程序:

                  In order to compile the boost for win32 on Ubuntu 12.04 I used this procedure:

                  tar jxf boost_1_50_0.tar.bz2
                  cd boost_1_50_0
                  ./bootstrap.sh
                  echo "using gcc : 4.6 : i686-w64-mingw32-g++ : <rc>i686-w64-mingw32-windres <archiver>i686-w64-mingw32-ar ;" > user-config.jam
                  ./bjam toolset=gcc target-os=windows --address-model=32 variant=release threading=multi threadapi=win32 link=static runtime-link=static --prefix=/opt/boost_1_50_0-release-static-windows-32 --user-config=user-config.jam -j 10 --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged install
                  

                  为了在我的项目中编译文件,我使用类似

                  In order to compile files in my project I use something like

                  i686-w64-mingw32-g++ -march=corei7 -mfpmath=sse -m32 -Wall -fmessage-length=0 -I"/opt/boost_1_50_0-release-static-windows-32/include" -std=c++0x -O3 -g0 -DNDEBUG -I"myProject/src/cpp" -c -o myProject/build/release/src/cpp/myproject.o myproject/src/cpp/myproject.cpp
                  

                  我的测试表明正则表达式运行良好,但我仍然想解决警告.

                  The tests I have indicate that the regexps run fine but still I would like to resolve the warning.

                  编辑

                  我发现可以使用 bjam 的 cxxflags= 参数为 boost 编译器添加其他选项.

                  I found that additional options to the boost compiler can be added using a cxxflags= argument of bjam.

                  示例:bjam cxxflags='-fPIC' ....

                  Example: bjam cxxflags='-fPIC' ....

                  也许确保向项目传递与我相同的参数可以解决问题(特别是链接问题中建议的与优化相关的参数).

                  Maybe making sure to pass the same arguments as I do to the project could resolve the problem (particularly the arguments related to optimizations as suggested in the linked question).

                  推荐答案

                  你的编译器是用不同的选项编译的 :) 在 Linux 上编译库和在 Windows 上编译程序会导致存在同名 .data 段的情况,但它们的大小不一样.这在理论上可能很有趣,因为数据段是可写的,但实际上,这无关紧要.除非有证据表明这会导致我不知道的问题,否则您可以安全地取消该警告;不过,我不知道你是如何让它消失的.

                  Your compilers were compiled with different options :) Compiling the library on Linux and the program on Windows result in a situation where there is an identically named .data segment, but they aren't the same size. That could theoretically be interesting, inasmuch as a data segment is writable, but in practice, it shouldn't matter. Unless there is evidence to suggest this causes a problem of which I'm not aware, you can safely suppress that warning; I don't know how you'd make it go away, though.

                  这篇关于发布模式下的 Regex Boost 库链接警告“重复部分的大小不同"使用 mingw-w64 工具链时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何打印矢量的数据 下一篇:无法在 boost 1.57 中编译 boost/any_iterator.hpp

                  相关文章

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

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

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