Solve problems similar to/usr/lib64/libstdc++.so.6:version ' glibcxx_3.4.21 ' not found

Source: Internet
Author: User

Source compilation upgrade After installing GCC, when compiling programs or running other programs, there are sometimes problems like/usr/lib64/libstdc++.so.6:version ' glibcxx_3.4.21 ' not found. This is because when you upgrade GCC, the generated dynamic libraries do not replace the dynamic libraries of the old version of GCC, which can be resolved by replacing the latest version of GCC's dynamic library with the old version of the dynamic library.


1. Problem reason Analysis

To install the latest version of Node.js (the latest version of Node.js uses C + + 11, and C + + requires CODE>GCC 4.8+ to support), the GCC is upgraded to the current latest version of V 5.2.0. After the upgrade, a new version of Node.js (v 4.2.1) was successfully compiled, but the following error occurred during the Run-time program:

Node:/usr/lib64/libstdc++.so.6:version ' glibcxx_3.4.21 ' not found (required by node)
node:/usr/lib64/libstdc++. So.6:version ' glibcxx_3.4.15 ' not found (required by node)
node:/usr/lib64/libstdc++.so.6:version ' Glibcxx_ 3.4.20 ' not found (required by node)

Run the following command to check the dynamic library:

strings/usr/lib64/libstdc++.so.6 | grep GLIBC


The output results are as follows:

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

As you can see from the above output, the dynamic library of GCC is still the old version. These problems are explained by the fact that the generated dynamic libraries did not replace the dynamic libraries of the old version of GCC when you upgraded GCC.


2. Problem-handling

Perform the following command to find the latest dynamic library generated when compiling GCC:

Find/-name "libstdc++.so*"

The output is as follows:

/home/gcc-5.2.0/gcc-temp/stage1-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so
/home/ Gcc-5.2.0/gcc-temp/stage1-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/home/gcc-5.2.0/ gcc-temp/stage1-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.21  //Latest dynamic Library ...

/home/gcc-5.2.0/gcc-temp is the output directory when you upgrade GCC.

Copy the latest dynamic library libstdc++.so.6.0.21 above to the/USR/LIB64 directory:

cp/home/gcc-5.2.0/gcc-temp/stage1-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.21/usr/ Lib64


After replication, modify the system default dynamic library's point, that is, to rebuild the default library soft connections.

Switch working directory to/usr/lib64:

Cd/usr/lib64

Remove original Soft connection:

RM-RF libstdc++.so.6

Point the soft connection of the default library to the latest dynamic library:

Ln-s libstdc++.so.6.0.21 libstdc++.so.6


The default dynamic library upgrade is complete. Rerun the following command to check the dynamic library:

strings/usr/lib64/libstdc++.so.6 | grep GLIBC

Now the output is as follows:

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_3.4.14
glibcxx_3.4.15
glibcxx_3.4.16
glibcxx_3.4.17
glibcxx_ 3.4.18
glibcxx_3.4.19
glibcxx_3.4.20
glibcxx_3.4.21
glibc_2.3
glibc_2.2.5 2.3.2
glibcxx_force_new
glibcxx_debug_message_length

Original address: http://itbilu.com/linux/management/NymXRUieg.html


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.