Dear all,
I'm running matlab r2017a on a linux Fedora 25 machine and when I tried to call an external program that required the graphical interface I got the following error.
OpenSees: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by OpenSees)
OpenSees: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by OpenSees)
When I used a built-in function of matlab I also got a similar error
Error using waitbar (line 111) Improper arguments for waitbar.
Error in selectRecords (line 8) h = waitbar(0,'Processing records');
Caused by: Error using axes Can't load '/usr/local/MATLAB/R2017a/bin/glnxa64/libmwosgserver.so': /usr/local/MATLAB/R2017a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /lib64/libGLU.so.1)
I checked using the terminal and I've got the latest version of that library installed
sudo dnf install libstdc++ Last metadata expiration check: 0:56:33 ago on Tue Mar 14 13:05:15 2017.Package libstdc++-6.3.1-1.fc25.x86_64 is already installed, skipping.Package libstdc++-6.3.1-1.fc25.i686 is already installed, skipping.Dependencies resolved.Nothing to do.Complete!
Could you please provide some guidance on how to solve this issue?
cheers L.M.

댓글 수: 1

Nader Fathy
Nader Fathy 2021년 2월 9일
Hello,
I had a similar issue using CentOS 7 and the following solved the issue for me:
yum install compat-libstdc++-33.x86_64
Hope this helps!
Kindest Regards,
Nader Fathy

댓글을 달려면 로그인하십시오.

 채택된 답변

Archita P
Archita P 2017년 3월 20일
편집: Archita P 2017년 3월 20일

23 개 추천

This issue might be due to an incompatibility between the libstdc++ shipped with MATLAB and the libstdc++ shipped with the system that the other application was linked against.
"CXXABI_1.3.9 not found" error message indicates that the libstdc++.so.6 library that is included with MATLAB is missing ABI versions the system needs to draw graphical content.
This is caused because the version of this particular library packaged with MATLAB is older than the versions that come with newer Linux operating systems, which causes compatibility issues.
You can try the following workarounds: 1. Renaming the libstdc++.so.6 library file so that MATLAB cannot find it and is forced to use the system's version of the library. This file is located in matlabroot/sys/os/glnxa64 . Renaming it to libstdc++.so.6.old should suffice. (where "matlabroot" is root installation directory of MATLAB)
2. Forcing MATLAB to load the system version by setting the $LD_PRELOAD environment variable to the newer version of libstdc++.
Also, since you are trying to call an external program from MATLAB, this may be a third party issue. But, you can try setting the library paths correctly in 'LD_LIBRARY_PATH' system variable.

댓글 수: 15

Luis Martins
Luis Martins 2017년 3월 20일
편집: Luis Martins 2017년 3월 20일
Thank you for the feedback.
I found that calling matlab with the command LD_PRELOAD=/usr/lib64/libstdc++.so.6 matlab -desktop seems to solve the issue
in order to avoid having to type this command every time I also assigned an alias on my .bashrc file alias matlab="LD_PRELOAD=/usr/lib64/libstdc++.so.6 /usr/local/bin/matlab -desktop"
It would be nice to see Mathworks providing update packages to its software though. For example with replacements for outdated libraries.
Cheers
James Graham
James Graham 2017년 10월 24일
I had exactly the same problem as this, running Matlab r2017b on Ubuntu 16.04. The error message occurred for me when I ran the "matlab" command from the terminal, although Matlab still opened.
I found the above suggestion very useful. I needed to modify the command in my .bashrc slightly to reflect my file structure and a slightly newer library version, so I used:
alias matlab='LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /usr/local/bin/matlab -desktop'
In any case, the suggestion worked perfectly, thanks!
James
Dennis Mattes
Dennis Mattes 2018년 5월 24일
Hi, I use also use Ubuntu 16.04 and have MATLAB 2018a installed. I triedd your suggestion for the command, with a small change becuase of the file structure:
alias matlab='LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /usr/local/matlab -desktop'
but sadly the error still occur. Do you have some idea?
Thanks in advance!
Hi Dennis: I had the same problem. type
locate libstdc++
I found that the version matlab needed was 6.0.22 and was found in
/usr/local/MATLAB/R2018a/sys/os/glnxa64/libstdc++.so.6.0.22
but it was instead loading version 6.0.21 from my /usr/lib/gcc directory
Setting
export LD_PRELOAD=/usr/local/MATLAB/R2018a/sys/os/glnxa64/libstdc++.so.6.0.22
solved the problem (temporarily)
Clyde Webster
Clyde Webster 2019년 5월 6일
Hi, I've tried all the solutions presented here but unfortunately the issue persists.
Does anyone have further advice?
OS: Ubuntu 16.04
MATLAB: R2018b
BRSC User
BRSC User 2020년 4월 9일
  • Find the dynamic library libstdc ++. So.6 with "locate libstdc++". In the installation directory of matlab, for example, mine is: /usr/local/MATLAB/R2019b/sys/os/glnxa64/libstdc++.so.6.
  • use the ll command. You can see: libstdc ++. So.6-> libstdc ++. So.6.0.22*
  • Then rename the dynamic library, for example: sudo mv libstdc ++. So.6 libstdc ++. So.6.bak (note that sudo permission is required)
  • After this operation, you can force the program to use the libstdc ++. So.6 dynamic library in the system directory.
  • After re-run the program, the problem is solved
DavyG
DavyG 2021년 5월 18일
Thanks BRSC User, works perfecly.
Juan Miguel Serrano Rodríguez
Juan Miguel Serrano Rodríguez 2021년 12월 16일
Fixed it for me on Fedora 35
Stefan Katletz
Stefan Katletz 2022년 2월 4일
On Fedora 35 it was sufficient to remove the link
matlabroot/sys/os/glnxa64/libstdc++.so.6
Orion Taylor
Orion Taylor 2022년 6월 10일
renaming it to .old fixed the issue I was having! Thanks!
Firat Soylu
Firat Soylu 2022년 8월 15일
Renaming libstdc++.so.6 to libstdc++.so.6old solved it for me in MATLAB 2021B UBUNTU 20.04. Thanks!
Lukas Heyn
Lukas Heyn 2022년 11월 14일
solved the problem for me in Matlab R2022b and Ubuntu 22.04, too
cr
cr 2023년 2월 8일
This is brilliant. It worked. I had been banging my head for a day.
Mekus Meka
Mekus Meka 2024년 9월 19일
Brilliant!!
"1. Renaming the libstdc++.so.6 library file" worked fine for me.
Maurizio
Maurizio 2026년 3월 5일 20:16
Great - it is working for as well, after spending several days banging my head against a wall
FYI: Ubuntu 24.04 LTS and MATLAB R2025b

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

John Smith
John Smith 2019년 7월 12일

1 개 추천

You need to be careful with making sure you load the correct libstdc++6.
I use it to load "brainstorm", an EEG analysis program that requires the runtime Matlab library.
On Fedora 30, I solved it just as follows:
LD_PRELOAD="/lib64/libstdc++.so.6" path_and_name_of_programme_here
Also, note that you can check whether CXXABI_1.3.9 is included simply as follows:
strings /lib64/libstdc++.so.6 | grep CXXABI
You should then see that in the text part of that library. If it shows up, it means it should work.
S.Y Wang
S.Y Wang 2017년 12월 9일

0 개 추천

"import matlab.engine" should at the first line of the script.

댓글 수: 2

Hi,
I am still facing the same problem even after inducing the following line in .bashrc. Did I correctly entered the path in bashrc file?
#MATLAB
export PATH=/usr/local/MATLAB/R2017b/bin:$PATH
export MATLABCMD=/usr/local/MATLAB/R2017b/bin/glnxa64/MATLAB
alias matlab="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/local/bin/matlab
When I open matlab I found the message pasted below and it opens normally.
$ matlab
/usr/local/MATLAB/R2017b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libproxy.so.1) Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so
I am afraid will this affect processing?
Thanks
Ramesh
BRSC User
BRSC User 2020년 4월 9일
See suggested solution above.

댓글을 달려면 로그인하십시오.

Luis Rosety
Luis Rosety 2022년 5월 16일

0 개 추천

I had the same problem with Kubuntu 22.05 and the solution was what was posted in askubuntu.com:
  1. Star Matlab with
matlab -softwareopengl
2. Once in Matlab, run the command
opengl('save','software')

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2017년 3월 14일

댓글:

2026년 3월 5일 20:16

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by