8

I need to install GLIBCXX 3.4.15 on my Centos 6 version (to run a server for a game on Steam). I've googled around and had several websites where they installed programs where the error appeared where it said that 3.4.15 was needed (LoadLibrary ERROR: /usr/lib/libstdc++.so.6: version 'GLIBCXX_3.4.15' not found), but they just used a way to bypass it/not install it. When I did strings /usr/lib/libstdc++.so.6 | grep GLIBCXX, this was the output:

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

So, how would I directly install GLIBCXX 3.4.15 on Centos 6?

PMint
  • 539
  • 4
  • 6
  • 19

3 Answers3

7

I would consider this a hack but have used it on more occasions than I care to admit to get around compatibility issues with GLIBC, such as the one you're encountering.

The hack involves making a link in /usr/lib which includes the name of the library that a particular tool wants. The link then points to alternative name of the library.

Example

Say I wanted to create a link to libstdc++.so.6.

$ ls -l /usr/lib | grep libstdc++.so
lrwxrwxrwx.  1 root root       19 Dec 18  2010 libstdc++.so.6 -> libstdc++.so.6.0.14
-rwxr-xr-x   1 root root   950428 Sep 24  2010 libstdc++.so.6.0.14

It works out be something like this:

$ ln -s libstdc++.so.6 libstdc++.so.6.0.15

Checking the results:

$ ls -l /usr/lib | grep libstdc++.so
lrwxrwxrwx.  1 root root       19 Dec 18  2010 libstdc++.so.6 -> libstdc++.so.6.0.14
lrwxrwxrwx.  1 root root       19 Dec 18  2010 libstdc++.so.6.0.15 -> libstdc++.so.6.0.14
-rwxr-xr-x   1 root root   950428 Sep 24  2010 libstdc++.so.6.0.14

But I'm not sure this method will work since you're library will still be missing the version string, GLIBCXX_3.4.15.

If the hack is unsuccessful then you'll likely have to bite the bullet and install GLIBC in an alternative directory, and then override LD_LIBRARY_PATH or LD_PRELOAD so that the execution of just steam sees the modified library.

Example

$ LD_PRELOAD='mylibc.so anotherlib.so' program

Details on how to do this are covered a bit more here in this SO Q&A: Multiple glibc libraries on a single host.

slm
  • 369,824
2

Basically the version of the libstdc++ RPM package shipped by CentOS (4.4.7) is not recent enough for your application. CentOS offers longterm stability instead of the latest and the greatest versions, so that's not completely unexpected.

Fedora is normally quite a bit ahead and may run your server without any issues.

Alternatively you could build a newer version of libstdc++ from a more current source. I would start off the CentOS SPEC file in the gcc SRPM , the latest release from gcc.gnu.org and rework those to build my own RPM's.

Upgrades of C libraries were in the past a good way to break a system in unexpected ways though...

HBruijn
  • 7,418
0

I had the same problem with the grpc module (imported by google-cloud) for nodejs v6.9.2. This solution worked for me: (from https://forum.qt.io/topic/25032/solved-centos-6-3-glibcxx_3-4-15-not-found-error-in-qt5-install/8)

tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2
make
make install
cristis
  • 101