`GLIBCXX_3.4.15' not found when using mex file in matlab (linux)

from: http://www.360doc.com/content/14/0314/16/175261_360565922.shtml

 

Invalid MEX-file '*/*/*.mexa64': /usr/local/MATLAB/R2012b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by usr/local/lib/libopencv_calib3d.so.2.4)

 

 

If anyone have this problem and using LD_PRELOAD worked as well, it may be useful to change the matlab shortcut (matlab.desktop) adding a line like:
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libstdc++.so.6

if you don't know where is libstdc++.so.6, just write on the terminal:
locate libstdc++.so.6

------------------------------------------------------------------------------------------------------------------

Although I check with commands in terminal

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC

which shows version GLIBCXX_3.4.15 exists, MATLAB still repeats this error. After googling, I found that MATLAB searches the libraries firstly within its own library path /usr/local/MATLAB/R2012a/bin/glnxa64/ or /usr/local/MATLAB/R2012a/sys/os/glnxa64 and then the system library path. The build-in library is somehow out-of-date, and the version GLIBCXX_3.4.15 doesn’t exist in the old library. 

I tried to rename the build-in library into another name so that MATLAB can be forced to find the correct one, but there still many other candidates library files with the same name which are prior in the searching order. I need to rename all these old libraries with the same name to help MATLAB direct to correct one, which would be troublesome. 

Finally, I found an easy way to solve the problem by linking the correct library file with the MATLAB firstly searched old library file, i.e.,

sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 /usr/local/MATLAB/R2012a/bin/glnxa64/libstdc++.so.6

After running this command in my terminal, the world calms down.

转载于:https://www.cnblogs.com/cslxiao/p/3714069.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值