How to Compile boost with GCC 5 using old ABI?

前端 未结 1 1194
礼貌的吻别
礼貌的吻别 2020-12-30 12:53

I have downloaded a library that was compiled with a gcc 4.8 before the ABI change in GCC.

On my laptop (latest kubuntu) I have GCC 5.2. And When I installed boost,

相关标签:
1条回答
  • 2020-12-30 13:18

    To my knowledge, there are no prebuilt Boost packages for the old ABI in the official Kubuntu repositories, so you will have to build Boost yourself. The building process is documented here.

    Make sure you're building the same Boost version that was used when your library was built. If there were any Boost configuration macros defined, you will also have to define them the similar way. Otherwise you may encounter ABI incompatibilities between the library and Boost you've built.

    In order to switch libstdc++ to the old ABI you will also have to define _GLIBCXX_USE_CXX11_ABI to 0, as described here. For example:

    b2 -j8 variant=release define=_GLIBCXX_USE_CXX11_ABI=0 stage
    

    You will also need to define the macro when you build your own code that uses Boost and the library.

    The define property, along with many others, is documented here.

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