问题描述
我正在尝试编译一个共享库,它将在Ubuntu 11.04上调用MATLAB函数.像命令一样:
I am trying to compile a shared library which will call MATLAB function on Ubuntu 11.04. Like the command:
mcc - B cpplib:libStepCluster StepCluster.m
出现以下错误.
/usr/lib/i38-linux-gnu/i686-linux-gnu/4.5.2/cc1plus: /usr/local/MATLAB/R2010a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/lib/libppl_c.so.2)
/usr/lib/i38-linux-gnu/i686-linux-gnu/4.5.2/cc1plus: /usr/local/MATLAB/R2010a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libppl_c.so.2)
/usr/lib/i38-linux-gnu/i686-linux-gnu/4.5.2/cc1plus: /usr/local/MATLAB/R2010a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/lib/libppl.so.7)
/usr/lib/i38-linux-gnu/i686-linux-gnu/4.5.2/cc1plus: /usr/local/MATLAB/R2010a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libppl.so.7)
/usr/lib/i38-linux-gnu/i686-linux-gnu/4.5.2/cc1plus: /usr/local/MATLAB/R2010a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libgmpxx.so.4)
我知道代码可以在Ubuntu 10.10上正常工作,并已升级到Ubuntu 11.04.然后问题出来了.问题出在哪里,如何解决却又没有太多痛苦呢?
I konw the code works fine with Ubuntu 10.10, and upgraded to Ubuntu 11.04. Then the problem comes out. What is the problem and how to resolve it without too much pain?
推荐答案
MatLab R2011a编译错误解决方案.
MatLab R2011a Compile Error Solution.
下载并安装GCC-4.4
Download and install GCC-4.4
使用命令:mbuild -setup
Use command: mbuild -setup
选择选项1,然后您将获得一个文件,位于/usr/local/MATLAB/R2011a/bin/mbuildopts.sh
Choose option 1 and then you will get a file locate in /usr/local/MATLAB/R2011a/bin/mbuildopts.sh
搜索文件,并将所有编译器选项替换为gcc-4.4
Search the file and replace all the compiler option with gcc-4.4
然后编译它,就可以了!
Then compile it, it should be fine!
这篇关于使用Matlab R2011a在Ubuntu 11.04上编译Matlab mex文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!