MATLAB Function Simulink Block "Make Error"

조회 수: 9 (최근 30일)
Juan
Juan 2011년 10월 28일
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!

답변 (2개)

Ken Atwell
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
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
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

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by