sudo find / -name libstdc++.so.6
(2) 修改 $matlab/bin/.matlab7rc.sh 文件
LDPATH_PREFIX=''
改为
LDPATH_PREFIX= '/usr/lib/i386-linux-gnu'
注: 将后面的目录设为 libstdc++.so.6 所在的目录。注意,文件中出现了多处
LDPATH_PREFIX='',
笔者全部进行了替换。
重启Matlab.
Enjoy it!
以上 设置参考自:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/162466
Any program compiled with GCC 4.2, requires GLIBC++ 3.4.9 to
run. The problem is that MATLAB secretly changes
LD_LIBRARY_PATH on startup to point to the MATLAB version of
GLIBC++, so that GLIBC++ 3.4.9 can no longer be found. The
solution is to modify matlab/bin/.matlab7rc.sh so that
"LDPATH_PREFIX" contains the path to the version of GLIB
installed with your compiler, then this is found before the
matlab-supplied library. For non-root users, simply copy the
said file to your home directory and edit it there. The line
you are looking for reads (originally):
LDPATH_PREFIX=''
but there are several of these. You need to edit the one in
the case statement for your architecture: you can identify
this by finding the set of lines:
#----------------------------------------------------------------------------
;;
glnx86)
#----------------------------------------------------------------------------
where instead of "glnx86", it reads out your architecture.
"glnx86" is Gnu/Linux x86; "glnxi64" is (I think) Gnu/Linux
Itanium 64-bit. As to the path you need to insert, you need
to find a path on your machine which holds the file
"libstdc++.so.6" (probably a symlink). On the Ubuntu Gutsy I
just installed, this is simply enough at "/usr/lib".