GLIBCXX_3.4.21 in CentOS

18,425

this worked for me on CentOS7

export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64

https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths

Share:
18,425

Related videos on Youtube

DragonZ
Author by

DragonZ

Updated on September 18, 2022

Comments

  • DragonZ
    DragonZ almost 2 years

    I have created c++ application in Ubuntu machine. I have copied binary to Centos machine. Got error:

    /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
    

    I have installed packages I thought was needed:

    yum install gcc gcc-c++ make openssl-devel
    

    Still got the same error.

    Then I have installed whole development tools:

    yum groupinstall 'Development Tools'
    

    Still have the same error. How to solve this problem?

    UPD

    I decided to check which versions of glibc I have in my machines with help of ldd --version command:

    Ubuntu: 2.23
    Centos6.9: 2.12
    

    Why CentOS cmplains regarding GLIBCXX_3.4.21, while Ubuntu owns glibc version 2.23?

  • thrig
    thrig over 6 years
    Different linux are different. You can either compile for each one, or try to compile something more portable, or try to use something like patchelf to fiddle around with the libraries. Or you can ship all the libraries your binary needs with the binary, or you can try to build RPM for the glibc that Ubutu has (without breaking what RedHat ships, hopefully) ...