I would like to use devtoolset-7 to build a C++11 application on CentOS 7. I am trying to use the <regex> library, but the version of libstdc++ included natively with CentOS 7, 4.8.4, does not support it.
I have followed the following instructions to install and enable SCL/devtoolset-7:
$ sudo yum install centos-release-scl
$ sudo yum install devtoolset-7
$ scl enable devtoolset-7 bash
At this point, if I invoke g++, it is the proper version (7.2.1), but when I build applications and run ldd on them, they are still dynamically linked to the old /lib64/libstdc++.so.6 on the system. What is the simplest way to reliably link against devtoolset-7-libstdc++-devel-7.2.1? I am using CMake 3 as the build system.