[CentOS] C++11 and GCC 5+

Alice Wonder alice at domblogger.net
Mon Jul 2 03:05:52 UTC 2018


This may be common knowledge to some, but it was new to me.

Libraries that use C++11 and are compiled with GCC 4.8.x that CentOS 7.x 
has are NOT binary compatible with GCC 5.x or newer.

It seems to only effect C++11.

What you have to do -

create /opt/gcc55 (or whatever)

Rebuild any libraries that use C++11 that you need in something compiled 
with GCC 5+ and install them within that prefix.

Then point to them in that prefix when building what you need to build.

-=-

The Linux runtime linker seems to get it right (as long as you have 
/opt/gcc55/lib64 in path) and not load wrong version of library, so you 
don't need to use rpath.

But you do need to have a version of the dependency compiled with the 
GCC you want available at both compile time and runtime.

-=-

I ran across this issue when building Audacity 2.2.2 - which does not 
build with GCC 4.8.5.

The problem libraries:
* flac
* vamp-sjdk-plugin
* wxGTK3

All three of those use C++11 and therefore needed to be rebuilt with GCC 
5.5.0 (what I used for building Audacity)

Just thought I'd pass it along.



More information about the CentOS mailing list