Home > Backend Development > C++ > body text

Why Am I Getting the 'GLIBCXX_3.4.15 Not Found' Error During Compilation?

Barbara Streisand
Release: 2024-11-25 16:28:11
Original
803 people have browsed it

Why Am I Getting the

Resolving "GLIBCXX_3.4.15' Not Found" Issue

While compiling programs, you may encounter an error stating "GLIBCXX_3.4.15 not found." Despite your suspicion that GLIBCXX_3.4.15 is missing from your Ubuntu system, this is not necessarily the case.

To verify the available GLIBCXX versions, you can run the command:

strings /usr/lib/libstdc++.so.6 | grep GLIBC
Copy after login

If the output contains GLIBCXX_3.4.15, then the library is present but may not be properly linked to the program you're trying to compile.

Solution:

The error may occur when compiling with a gcc version that is higher than the system default. In this situation, the new gcc version might require GLIBCXX_3.4.15, which is not available in the system directories.

To resolve this issue, manually locate the GLIBCXX_3.4.15 library file and redirect libstdc .so.6 to point to it. In the example provided, the library file is located at:

gcc/trunk/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.15
Copy after login

Copy this file to /usr/lib and create a symlink to redirect libstdc .so.6:

sudo cp gcc/trunk/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.15 /usr/lib/
sudo ln -sf /usr/lib/libstdc++.so.6.0.15 /usr/lib/libstdc++.so.6
Copy after login

After completing these steps, the program should compile successfully.

The above is the detailed content of Why Am I Getting the 'GLIBCXX_3.4.15 Not Found' Error During Compilation?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template