Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

gcc

libstdc++

People also ask

How do I know what version of Libstdc ++ I have?

You could use g++ --version in combination with the GCC ABI docs to find out.

What is Libstdc?

1.1. What is libstdc++? The GNU Standard C++ Library v3 is an ongoing project to implement the ISO 14882 C++ Standard Library as described in clauses 20 through 33 and annex D (prior to the 2017 standard the library clauses started with 17).


I'm compiling gcc 4.6 from source, and apparently

sudo make install 

didn't catch this one. I dug around and found

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

I copied it in to /usr/lib and redirected libstdc++.so.6 to point to the new one, and now everything works.


I have been avoiding this issue in the past by simply linking libstdc++ statically with this parameter sent to g++ when linking my executable:

-static-libstdc++

If linking in the library statically is an option this is probably the quickest work-around.


I was trying to get clang to work (which also requires 6.0.15), and while poking around I found it was installed at /usr/local/lib/libstdc++.so.6.0.15. It installed there when I installed graphite (an experimental gcc version).

If you need access to libraries at that location, then you’ll need to define LD_LIBRARY_PATH as:

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

I was able to get clang to work after doing this. Hope that is helpful to someone.


I encounter this problem when trying to use matlab eng to call m functions from c code. which occurs with command mex -f .. ..

My solution:

strings /usr/lib/i386-<tab>/libstdc++.so.6 | grep GLIBC

I found it includes 3.4.15

so my system has the newest libs.

the problem comes from matlab itself, it calls its own libstdc++.so.6 from {MATLAB}/bin

so, just replace it with the updated system lib.


I have just faced with similar issue building LLVM 3.7 version. first check whether you have installed the required library on your system:

$locate libstdc++.so.6.*

Then add the found location to your $LD_LIBRARY_PATH environment variable.


I got same error. This is how it worked for me:

  • cleaned the project under currently installed gcc
  • recompiled it

Worked perfectly!