[CentOS] devtoolset-4

Thu May 19 21:02:45 UTC 2016
Warren Young <wyml at etr-usa.com>

On May 19, 2016, at 3:30 AM, Jarosław Bober <jaroslaw.bober at gmail.com> wrote:
> Do I have to  install devtoolset on all my machines that I want to run this
> app?

Probably, yes.  That, or redistribute parts of it with your app, either by cherrypicking files from the devtoolset RPM or statically linking to it.

> Or would it use built-in libstdc++ library, linking statically only
> the missing parts?

Are you asking if the new libstdc++ is statically linked into your app only for the new functions but your app remains dynamically linked to the old one for the parts of C++ that have remained unchanged, the answer is “no”.  Your app is linked to the new library, period.  You can use ldd(1) to prove this to yourself.

Yes, this is a pain, which is why most people writing software for older CentOS releases don’t upgrade their development tools.  There’s a lot to be said for holding off on using new language features until they’re available in the stock version of the tools for all OSes you need to deploy on.

I’d like to be using C++11 myself, but a feature-complete version of C++11 didn’t appear in g++ until 4.8, which first shipped in CentOS 7.  I just got done backporting a feature to a 32-bit CentOS 5 box, so I’m probably not going to be able to use C++11 for another 3-5 years.  Sad, but I still get the work done with C++98.