I got 'duplicate section' errors when compiling boost_regex with size optimization (-Os)

前端 未结 3 1752
情歌与酒
情歌与酒 2020-12-31 14:06

compiler: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev6.7z

boost: http://

相关标签:
3条回答
  • 2020-12-31 14:26

    I got the same error when I compile my code use gcc-4.9.1 in MinGW32 with a lib which use gcc-4.4.7 as the compiler. And I also used ccache to speed up,ccache is also a problem. Remove the cache in ~/.ccache/ and recompiled then I workaround this.

    0 讨论(0)
  • 2020-12-31 14:29

    I believe this is a compiler bug. The workaround in my case was to add -fno-tree-vectorize.

    0 讨论(0)
  • 2020-12-31 14:41

    In my case boost 1.58 was internally compiling with "-march=i686", but my code wasn't. Adding "-march=i686" to my project got rid of all "duplicate section".

    lesson learned: always make painstakingly sure that all libraries and the main project are compiled with identical compiler options.

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