/Usr/lib64/libstdc ++. so.6: version 'glibcxx _ 3.4.14 & amp; #39; notfound Solution

Source: Internet
Author: User

Problem REPLAY: when we run a program compiled in the C series language, we may receive this error, the corresponding C ++ standard library for GLIBC version 3.4.14 is not found.

Problem origin: first, we need to know that a program needs to be dynamically linked after it is loaded, and the dynamic link requires the glibc library of the corresponding version. But which version of glibc library is required for our executable files?

This version problem already exists in our Executable File ELF format. We can use the command to view the result.

[22: 10huangyk @ leetcode] $> strings numDistinct | grep GLIB
GLIBC_2.2.5
GLIBCXX_3.4.5
GLIBCXX_3.4.14
GLIBCXX_3.4

Now we can see the GLIB library version required for loading ELF files. When was the version information added?

Answer: It was added when the gcc program was compiled. That is to say, if the GLIBC library versions of the two platforms are different and the GCC versions are different, their binary files cannot be universal.

Q: Where can I find the local GLIBC library? How can we find the corresponding version?

Answer: The default dynamic link library is stored in/usr/lib64/libstdc ++. so.6. However, if we compile GCC ourselves, the location of the library files corresponding to libc and libc ++ will change. If our installation path is/usr/local/gcc4.8.3The corresponding library file location is/usr/local/gcc4.8.3/lib:/usr/local/gcc4.8.3/lib64.

Q: Why does the above error still occur when I have installed the GLIBC library?

Answer: Although we have installed the corresponding database, the connector cannot find the location of the new database. Then, find the corresponding file in the original directory/usr/lib64/libstdc ++. so.6. So,We need to use the environment variable LD_LIBRARY_PATH to specify the location of the dynamic link library.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.