Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating /usr/include/c++ in CentOS-7

I have installed the devtoolset-10 package on CentOS 7 and run the /opt/rh/devtoolset-10/enable script so that now when I do this:

g++ --version

I get this:

g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)

Great. Trouble is, the headers under /usr/include/c++ still point to ye olde libstdc++-4.8.5. That is, if I do ls in /usr/include/c++, all I see is:

bash-4.2$ ls /usr/include/c++
4.8.2  4.8.5

What is the magic incantation to "enable" libstdc++-10 to be the default system C++ stdlib?

like image 582
Eric Niebler Avatar asked Nov 15 '25 16:11

Eric Niebler


1 Answers

devtoolset-10

Every g++ comes with it's own headers. /usr/include/c++/4.8* is for 4.8.5 only.

devtoolset-10: g++ version 10 is using the headers at /opt/rh/devtoolset-10/root/usr/include/c++/10

"enable" libstdc++-10

There is no shared library "libstdc++-10". There is /opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/{ libstdc++.a, libstdc++.so } , where libstdc++.so is a ~200B text file.

like image 159
Knud Larsen Avatar answered Nov 17 '25 07:11

Knud Larsen