MATLAB Function Simulink Block "Make Error"
11 次查看(过去 30 天)
显示 更早的评论
Hi, So I'm new with Simulink, I have the student version on my mac and I'm trying learn how to use MATLAB function blocks so I tried the example from the help menu. However, when I run it I get a "Make error":
Making simulation target "test_sfun", ...
/Applications/MATLAB_R2011a_Student.app/bin/mex -c -O -DMATLAB_MEX_FILE -I/Applications/MATLAB_R2011a_Student.app/toolbox/stateflow/stateflow/../../../simulink/include -I/Applications/MATLAB_R2011a_Student.app/toolbox/stateflow/stateflow/../../../extern/include -I/Applications/MATLAB_R2011a_Student.app/stateflow/c/mex/include -I/Applications/MATLAB_R2011a_Student.app/stateflow/c/debugger/include test_sfun.c /Applications/MATLAB_R2011a_Student.app/bin/mex: line 305: gcc-4.2: command not found /Applications/MATLAB_R2011a_Student.app/bin/mex: line 1041: gcc-4.2: command not found
mex: compile of ' "test_sfun.c"' failed.
gmake: * [test_sfun.o] Error 1
Can anyone please tell me how to fix this?
Cheers!
0 个评论
回答(2 个)
Ken Atwell
2011-11-4
A Fangjun, indicated, you need a C compiler, namely the one provided with Xcode. If you already have (or now install) Xcode v4.2 (the newest version, released in the last couple of weeks), you will still get this error since recent versions of MATLAB are configured to use a compiler that is no longer provided as-of Xcode v4.2.
The MathWorks solution Can I use XCode 4.2 as my C compiler in MATLAB R2011b? may be helpful. You can get information on the officially supported compilers at Supported and Compatible Compilers – Release 2011b
1 个评论
Egor
2012-10-8
thank you! worked for me for solving stateflow mex compiler on osx 10.8.2 with Xcode 4.5.2
Fangjun Jiang
2011-10-28
It might be that you don't have a C compiler. Or you have not set up mex yet. try to run
mex -setup
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!