matlab识别不出linux链接,linux: Matlab 找不到 libstdc++.so.6

本文介绍了如何修正Matlab启动时由于GLIBC++版本不兼容导致的问题,通过修改.bin/.matlab7rc.sh文件,将LDPATH_PREFIX指向正确版本的libstdc++.so.6路径,避免Matlab默认的GLIBC++覆盖。非root用户可复制文件并编辑。关键在于定位并替换LDPATH_PREFIX=''中的路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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".

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值