![](/uploads/1/2/6/5/126553239/890462607.jpg)
UPDATEA simple workaround seems to be yo use
Reverse dependencies ( 205 ) Reverse dependencies are Solaris packages that depends on libstdc6. /usr/lib/libstdc.so.6: version `GLIBCXX3.4.15' not found. Posted by: admin. Copy the the libstdc.so.6.0.15 or latest from other server to the affected system.
And in Matlab:
More info here
NOTE: All this was done in Ubuntu 12.04 64 bits.
When using Matlab and external programs or mex compiled functions it can occur that:
This problem comes from the GCC program. It seems that this library libstdc++.so.6 is compiled but not installed when installing GCC ([1]).
Another problem could be that the version of libstdc++.so.6 is so old so your version of GLIBCXX is older that the one you are required.
The simplest solution is to check where is linked the following file [2]:
By using the locate command:
And it will return something like:
So now you have information enough to 'update' the link you the libstdc++.so.6 by creating a symbolic link:
UPDATE!
When solving the previous error, the same error appeared but in another folder, so just recreate the symbolic link with the proper folder and in will work without doing all the following stuff (don't care about versions, I was doing this in other pc):
This solution could fix the problem of running external programs from Matlab, such as GNUplot.
My case was much harder: I was using mex files, and those mex files were compiling OK but when running the mex64a files MATLAB was not able to find that library. Eventhough MATLAB includes that library within its files...
Before testing every solution, be sure to close Matlab and open it again.
You can try the following things:
- Update symbolic links [3]
![Libstdc Libstdc](http://minecraftpe-mods.com/_ld/8/22363023.jpg)
Note that gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.15 is the trunk compiled from the GCC. You won't probably have that, but if you have libstdc++.so.6.0.15 (or whatever) in other folder just change this folder. Recreate the symbolic links:
- Get GCC code and compile it locally. [4] Before that, try to remove all the symbolic links previously done or already existing before the error, and revert all the stuff you have done until now. So, here we go!:
First install Subversion and get the code from the repository [5]:
Check the repository here in case you rather prefer getting a branch than the trunk version.
While downloading (it takes a long while), open a terminal and create the Makefile from the configure:
These options are the one which worked from me. To make the compilation faster other options you can add are --disable-libquadmath if not using fortran, and --disable-libmudflap and --disable-libitm if you don't want to use those features. You can also speed up builds by using --disable-bootstrap CFLAGS='-g3 -O0' [6].
After that, the output will probably look as follows:
So you will need to add the missing dependencies:
If you are working in a 64bits-machine, the compilation will probably fail if you do not write the following before start compiling [7]:
Finally, we can compile:
After 3-4 hours (approximately in my case) you can run sudo make install if you want to use the latest version of GCC. I did:
And everything was broken :) Don't worry. Since the new compiler is installed, it is going to be called by default when trying to compile something but it is not configured. Keep reading.
Both if you don't want to install GCC trunk version or you already did, to solve the initial problem, the final step is to copy the file we just compiled
to /usr/lib/ or any other folder such as /usr/local/lib/ in my case (it could be installed there by another program). If copied to this folder:Go to bashrc and include the following line:
And add the following line: /usr/local/libThen run
Once again, generate the symbolic links:
After all this stuff, a lot of things have been done so it is probable that some symbolic links or .so files are messed up. Currently, all these commands worked for me but the state I left my computer is a mess (I have 3 different symbolic links for libstdc++.so.6 and libstdc++.so.5) But so far, it works :)
Of course, the mex files of Matlab have to be compiled again.
Useful notes:
- With $ ls -al it is possible to see where it is a library pointing. There are other commands for this but I can't remember.
Retrieved from 'http://sgpsproject.sourceforge.net/JavierVGomez/index.php?title=Solving_issues_with_GLIBCXX_and_libstdc%2B%2B&oldid=637'
![](/uploads/1/2/6/5/126553239/890462607.jpg)