How to compile boost with GCC 5 using old ABI?

I downloaded the library that was compiled with gcc 4.8 before changing the ABI in GCC.

On my laptop (latest kubuntu) I have GCC 5.2. And when I installed boost, it seems like he was using a new ABI, but then I get the following link errors

undefined character .....__ cxx11 ....

How can I install boost using old ABI with GCC5?

+5
source share
1 answer

As far as I know, the official Kubuntu repositories do not have ready-made Boost packages for the old ABI, so you have to create Boost yourself. The build process is documented here .

Make sure you create the same version of Boost that was used to create your library. If there were specific Boost configuration macros, you would also need to define them in a similar way. Otherwise, you may encounter ABI incompatibility between the library and the Boost that you created.

To switch libstdC ++ to the old ABI, you also need to set _GLIBCXX_USE_CXX11_ABI to 0, as described here . For instance:

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

You also need to define a macro when creating your own code that uses Boost and the library.

+6
source

Source: https://habr.com/ru/post/1246074/


All Articles