Try running yum provides libstdc++ to show you what package provided the library on your system. You can then check if those packages are available for update using yum list available | grep <that package> followed by yum update <that package>.

Answer from micmoyles on Stack Overflow
🌐
Stack Exchange
unix.stackexchange.com › questions › 277483 › installing-libstdc-devel-on-my-centos-server
software installation - Installing libstdc++-devel on my CentOS server - Unix & Linux Stack Exchange
April 19, 2016 - rpm -qa | grep libstdc++ gives: libstdc++-4.8.3-9.el7.x86_64 However, find . -name "*libstdc++*" gives: ./usr/lib/gcc/x86_64-redhat-linux/4.8.2/32/libstdc++.a ./usr/lib/gcc/x86_64-redhat-linux/4...
🌐
Serverkurma
serverkurma.com › linux › how-to-install-and-update-gcc-on-centos-7
How to install and update GCC on Centos 7 – ServerKurma – Bilişim Hizmetleri
February 19, 2018 - ... ../gcc-6.1.0/configure –enable-languages=c,c++ –disable-multilib && make -j <number of CPU cores> && sudo make install && echo “success” · you have too add these paramaters : –enable-languages=c,c++ –disable-multilib ... cd /usr/local/lib64 cp libstdc...
🌐
CentOS Repositories
centos.pkgs.org › 7 › centos-sclo-rh-testing-x86_64 › devtoolset-7-libstdc++-devel-7.2.1-1.el7.x86_64.rpm.html
devtoolset-7-libstdc++-devel-7.2.1-1.el7.x86_64.rpm CentOS 7 Download
Install devtoolset-7-libstdc++-devel rpm package: # yum --enablerepo=centos-sclo-rh-testing install devtoolset-7-libstdc++-devel · 2017-08-31 - Marek Polacek <polacek@redhat.com> 7.2.1-1 - update from Fedora gcc-7.2.1-1 · 2017-08-28 - Marek Polacek <polacek@redhat.com> 7.1.1-7.1 - don't Provide "gcc" (#1485002) 2017-08-03 - Jakub Jelinek <jakub@redhat.com> 7.1.1-7 - update from Fedora gcc-7.1.1-7 ·
🌐
Installati.one
installati.one › home › how to install libstdc++ on centos 7
How To Install libstdc++ on CentOS 7 | Installati.one
May 1, 2023 - In this tutorial we learn how to install libstdc++ on CentOS 7 using yum and dnf.
🌐
Installati.one
installati.one › home › how to install libstdc++-devel on centos 7
How To Install libstdc++-devel on CentOS 7 | Installati.one
May 1, 2023 - In this tutorial we learn how to install libstdc++-devel on CentOS 7 using yum and dnf.
Find elsewhere
Top answer
1 of 3
6

Commentary on YUM & deps

YUM does do this. But it's only as good as the RPM specifies. In this case your RPM states that it'll work with any GLIBC > 2.13 but it clearly was built with a specific version of GLIBC, and will only work if the appropriate GCC symbols are available on the system:

$ rpm -qpR trillian-6.1.0.5-1.fc25.x86_64.rpm
atkmm >= 2.22.0
cairo >= 1.12.0
cairomm >= 1.10.0
gdk-pixbuf2 >= 2.26.0
glib2 >= 2.30.0
glibc >= 2.13
glibmm24 >= 2.32.0
gtk3 >= 3.4.0
gtkmm30 >= 3.4.0
libX11 >= 1.5.0
libXScrnSaver >= 1.2.0
libnotify >= 0.7.5
librsvg2-tools >= 2.36.0
libsigc++20 >= 2.2.10
libzip >= 0.10.0
openssl-libs >= 1:1.0.1
pango >= 1.30.0
pangomm >= 2.28.0
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
zlib >= 1.2.0

You can use rpm -qpR <rpm> to determine what dependencies it requires.

More on your issue

The heart of your issue is you're attempting to use a package that was built using a different version of the GCC compiler vs. what run time libraries are actually available on your OS.

In your case you're on CentOS 7.x and you really cannot mix RPMs across Fedora & CentOS like this, or at least you shouldn't.

If you look at what package owns that shared library:

$ rpm -qf /lib64/libstdc++.so.6
libstdc++-4.8.5-28.el7_5.1.x86_64

You can also investigate the shared library itself to see what GCC symbols it supports:

$ nm -D /lib64/libstdc++.so.6 | grep -i GLIBC | head -5
0000000000000000 A GLIBCXX_3.4
0000000000000000 A GLIBCXX_3.4.1
0000000000000000 A GLIBCXX_3.4.10
0000000000000000 A GLIBCXX_3.4.11
0000000000000000 A GLIBCXX_3.4.12

And finally look to see if it includes the ones that this RPM's binaries is looking for:

$ nm -D /lib64/libstdc++.so.6 | grep -iE '3\.4\.20|3\.4\.21'
$

No surprises here, this .so library doesn't include the symbols for either of those versions of GCC, hence the error.

What to do?

The typical ways you deal with this are either:

  1. Get a binary built against your GCC's symbol definitions
  2. Get just the libstdc++.so.6 library from some other tool (many apps opt to include libraries for easier deployment/setup/installation) and point to it via your LD_LIBRARY_PATH. You typically do it like this:

    $ LD_LIBRARY_PATH=/path/to/lib trillian
    
  3. Run the app in a VM

  4. Run the app in a Docker container
  5. Get a version of the RPM that has binaries that were built using symbols that are consistent with your OS's GCC setup.

Given the similarities between Fedora & CentOS I've had good success with many of the above. You could try #5, and try one of the older Fedora RPMs on their website to see if it was built with CentOS's version of GCC symbols.

References

  • https://en.wikipedia.org/wiki/GNU_C_Library
  • How To Write Shared Libraries
  • Static, Shared Dynamic and Loadable Linux Libraries
2 of 3
3

yum resolves dependencies concerning other packages. In other words, it installs packages which are depended on by the package(s) that you are trying to install.

The error that you are receiving is due to the fact that the library file, /lib64/libstdc++.so.6, does not include GLIBCXX_3.4.20 or GLIBCXX_3.4.21. Usually, /usr/lib64/libstdc++.so.6 is a symlink to /usr/lib64/libstdc++.so.6.0.# where # is the highest version of GLIBCXX inside.

If you run this command, you'll see the versions of GLIBCXX which are included:

strings /usr/lib64/libstdc++.so.6 | grep -i ^glibcxx_

As you don't have it, you will need to install a package which contains those libraries.

The easiest package to install that provides it is:

Anaconda3

You can download it from Anaconda's website and there is a walkthrough on installing it. After it's installed, you can prepend Anaconda's library to your LD_LIBRARY_PATH. For example, if you installed it into /opt/anaconda3, then you'll add this line to your ~/.bash_profile or ~/.bashrc:

export LD_LIBRARY_PATH=/opt/anaconda3/lib:$LD_LIBRARY_PATH

You can then start a new shell session and run trillian again.

You can also source compile GCC6, GCC7, or GCC8 which will provide the correct libraries which you can then add to your path but you also have to source compile GMP, MPC, and MPFR which, in your case, is more trouble than it's worth.

🌐
GitHub
github.com › rordenlab › dcm2niix › issues › 137
centos -lstdc++ linking error: need libstdc++-static · Issue #137 · rordenlab/dcm2niix
October 10, 2017 - cd build/console-build && make /usr/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status resolved with yum install libstdc++-static on CentOS Linux release 7.3.1611 (Core) centos-release-0:7-4.1708.el7.centos.x86_64 I'...
Author   rordenlab
🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-newbie-8 › compat-libstdc-package-for-centos-4175538401
compat-libstdc++ package for CentOS
I am new to Linux OS. I have recently installed CentOS on Oracle Virtual Box. I need to install the compat-libstdc++ package now. Please guide me how
🌐
Red Hat
access.redhat.com › discussions › 1182083
Red Hat Customer Portal - Access to 24x7 support and knowledge
August 29, 2014 - I believe this used to be compat-libstdc++ but I can't find it with yum...
🌐
GitHub
github.com › EOSIO › eosio.cdt › issues › 252
CentOS Linux release 7.5.1804 (Core) & libstdc++ problem · Issue #252 · EOSIO/eosio.cdt
November 8, 2018 - rpm -ql libstdc++ /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.0.19
Author   EOSIO
🌐
Red Hat
access.redhat.com › solutions › 3393821
How to install libstdc++ [32 bit ] package on RHEL7 [64 bit] ? - Red Hat Customer Portal
# rpm -ivh libstdc++-4.8.5-25.el7.i686.rpm error: Failed dependencies: ld-linux.so.2 is needed by libstdc++-4.8.5-25.el7.i686 ld-linux.so.2(GLIBC_2.3) is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6 is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6(GLIBC_2.0) is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6(GLIBC_2.1) is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6(GLIBC_2.1.3) is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6(GLIBC_2.2) is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6(GLIBC_2.3) is needed by libstdc++-4.8.5-25.el7.i686 libc.so.6(GLIBC_2.3.2) is needed by libstdc++