MATLAB Function Simulink Block "Make Error"

10 visualizzazioni (ultimi 30 giorni)
Juan
Juan il 28 Ott 2011
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!

Risposte (2)

Ken Atwell
Ken Atwell il 4 Nov 2011
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 Commento
Egor
Egor il 8 Ott 2012
thank you! worked for me for solving stateflow mex compiler on osx 10.8.2 with Xcode 4.5.2

Accedi per commentare.


Fangjun Jiang
Fangjun Jiang il 28 Ott 2011
It might be that you don't have a C compiler. Or you have not set up mex yet. try to run
mex -setup

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by