正则表达式在释放模式升压库链接警告"重复部分都有不同的尺寸"使用的MinGW-W64链时 [英] Regex Boost library linking in release mode warns "duplicate section has different size" when using mingw-w64 toolchain

查看:243
本文介绍了正则表达式在释放模式升压库链接警告"重复部分都有不同的尺寸"使用的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库与不同的选项编译的,但我不知道如何找到差异(升压没有输出生成过程中这些选项)。

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我用这个方法:

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 =参数添加。

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

例如:
的bjam CXXFLAGS =' - 子卡......

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).

推荐答案

您的编译器,用不同的选择:)汇编编译在Windows结果在Linux上的库和程序的情况下有一个同名的。数据段,但它们不是相同的大小。这在理论上是有趣,因为作为一个数据段是可写的,但在实践中,它不应该的问题。除非有证据表明这会导致问题,其中我不知道,你可以安全地燮preSS的警告;我不知道你会怎么把它赶走,但。

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.

这篇关于正则表达式在释放模式升压库链接警告&QUOT;重复部分都有不同的尺寸&QUOT;使用的MinGW-W64链时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆