Matlab 2012a Mex与Mountain Lion上的Xcode 4.5一起使用

前端之家收集整理的这篇文章主要介绍了Matlab 2012a Mex与Mountain Lion上的Xcode 4.5一起使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我安装了Mountain Lion和 Xcode 4.5以及Matlab 2012a.我安装并运行了MathWorks网站上提供的补丁但是我仍然收到以下错误

/Applications/MATLAB_R2012a.app/bin/mex: line 305: llvm-gcc-4.2: command not found
/Applications/MATLAB_R2012a.app/bin/mex: line 1326: llvm-gcc-4.2: command not found

mex: compile of ' "hello.c"' Failed.
Error using mex (line 206)

有没有已知的解决方案?

Solution: Open Xcode –> Preferences –> Downloads –> Install
“Command Line Tools”

The MathWorks patch is still needed. Resolved issue for me.

解决方法

您不需要安装XCode.我安装了命令行工具,然后编辑文件“/Applications/MATLAB_R2012a.app/bin/mexopts.sh”和

将CC从gcc-4.2更改为llvm-gcc-4.2

将CXX从gcc-4.2更改为llvm-g -4.2

将SDKROOT设置为’/’

完成.现在,您只需要在MATLAB中运行“mex -setup”

为我工作(Mac OSX 10.8.2,命令行工具 – 2012年10月,MATLAB 2012a)

猜你在找的Xcode相关文章