Regex Boost library linking in release mode warns “duplicate section has different size” when using mingw-w64 toolchain

前端 未结 2 1224
甜味超标
甜味超标 2020-12-11 16:21

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): dupl         


        
相关标签:
2条回答
  • 2020-12-11 17:00

    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.

    0 讨论(0)
  • 2020-12-11 17:14

    I recently encountered this problem (i.e. linker warning "duplicate section has different size") when trying to compile boost for Windows using mingw.

    The issue I had was that I compiled my application with -std=c++14 but when compiling boost I didn't specifically provide a dialect flag (which defaulted to -std=c++98 for g++ 5.3.0). Adding the dialect flag -std=c++14 when compiling boost solved the problem for me. See this answer for an explaination on how to set cxxflags when compiling boost.

    I believe my solution might have worked for you (your application was compiled with -std=c++0x but boost was not provided any dialect flag). Although I am 6 years too late, I'll leave my answer here for others who happen to stumble-upon this issue.

    0 讨论(0)
提交回复
热议问题