/usr/../libstdc++.so.6:未找到版本`GLIBCXX_3.4.11'(需要...) [英] /usr/../libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ...)

查看:362
本文介绍了/usr/../libstdc++.so.6:未找到版本`GLIBCXX_3.4.11'(需要...)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直困扰这个问题几个星期,一直在互联网上寻找解决方案,但到目前为止不是很好...



所以我有一个程序由其他人写的,我尝试在Matlab中编译它,使其工作。我的电脑是红帽企业Linux工作站(64位)与gcc 4.4.3和Matlab 2011b安装。 gcc与我的Matlab兼容( http://www.mathworks.com/support /compilers/R2011b/glnxa64.html )。



编译工作正常(我的意思是,在Matlab命令窗口中不会出现错误信息)。但编译后,每次当我使用一个特定的函数从编译(它的调用mexLasso),它会显示像这样的错误:



***无效MEX-file'/usr/local/matlab_R2011b/toolbox/spams-matlab/build/mexLasso.mexa64':
/usr/local/matlab_R2011b/bin/glnxa64/../../sys/os/glnxa64 /libstdc++.so.6:version
`GLIBCXX_3.4.11'未找到(
需要/usr/local/matlab_R2011b/toolbox/spams-matlab/build/mexLasso.mexa64)



测试错误(第24行)
alpha = mexLasso(X,D,param);



所以我在终端中键入strings /usr/lib/libstdc++.so.6 | grep GLIBC,我发现GLIBCXX_3.4.11实际上是在它。



我一直在使用Linux和gcc的东西只有几个月...所以还有很多东西我不明白。如果你能详细解释它将是很大的帮助。谢谢!



%%更多细节:
我从机器学习 http://spams-devel.gforge.inria.fr/downloads.html 。最糟糕的是,在编译之后,该包中的其他函数工作正常(例如mexTrainDL)。

解决方案

由@whjiang提供,但有两个限制:


  1. 您可能需要具有 sudo

  2. 因此还有另一个。



    正如这个

    / strong>偏好< MatlabPATH> / sys / os /< ARCH>


    < MatlabPATH> / sys / os / libstdc ++。so.6 已过期。



    当调用Matlab时,解决方案设置为 LD_PRELOAD

      env LD_PRELOAD = usr / lib / libstdc ++。so.6< MatlabPATH> / bin / matlab -desktop 

    路径 libstdc ++。so.6 我不同于os到os。例如,在我的LMDE2上,路径是 / usr / lib / x86_64-linux-gnu / libstdc ++。so.6


    I have been stuck on this problem for several weeks and been looking around on Internet for solution but so far not so good...

    So I have a program written by someone else and I try to compile it in Matlab to make it work. My computer is Red-hat enterprise Linux workstation (64 bits) with gcc 4.4.3 and Matlab 2011b installed. The gcc is compatible with my Matlab (http://www.mathworks.com/support/compilers/R2011b/glnxa64.html).

    The compilation works fine (I mean, no error message occurs in Matlab command window). But after compilation, every time when I use a specific function from the compilation (it's call "mexLasso"), it will show up errors like this:

    ***Invalid MEX-file '/usr/local/matlab_R2011b/toolbox/spams-matlab/build/mexLasso.mexa64': /usr/local/matlab_R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/local/matlab_R2011b/toolbox/spams-matlab/build/mexLasso.mexa64)

    Error in test (line 24) alpha=mexLasso(X,D,param);*

    So I type "strings /usr/lib/libstdc++.so.6 | grep GLIBC" in the terminal, and I found the "GLIBCXX_3.4.11" is actually in it.

    I've been using Linux and gcc stuff for only several months...so there are still a lot of things I don't understand. It will be of great help if you can explain it in detail. Thanks!!

    %% More detail: I got these programs on machine learning from http://spams-devel.gforge.inria.fr/downloads.html. The wierd thing is, after compilation, other functions in that package works fine (such as "mexTrainDL").

    解决方案

    The solution prompted by @whjiang works but have two limits:

    1. You may be required a sudo privilege to change the library symbol link.
    2. The change is global and can affect all users

    So there is another.

    As explained by this answer from MATLAB Central, the problem is caused by Matlab:

    Matlab internally changes the LD_LIBRARY_PATH to prefer <MatlabPATH >/sys/os/<ARCH>

    and the <MatlabPATH>/sys/os/libstdc++.so.6 is out of date.

    The solution is set LD_PRELOAD when calling Matlab like this,

    env LD_PRELOAD=/usr/lib/libstdc++.so.6  <MatlabPATH>/bin/matlab -desktop
    

    The path of libstdc++.so.6 my be different from os to os. For example, on my LMDE2, the path is /usr/lib/x86_64-linux-gnu/libstdc++.so.6.

    这篇关于/usr/../libstdc++.so.6:未找到版本`GLIBCXX_3.4.11'(需要...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆