Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler.

Dear Friends
Hi,
I am developing a simulink and I am in the beggining stage of it, while I face the problem of : Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler.
Can any body help me to solve this?
Thanks

7 Comments

Which MATLAB version are you using and which compiler have you already installed?
https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/SystemRequirements-Release2013a_SupportedCompilers.pdf lists the supported compilers. Be sure to look in the correct section for 32 bit vs 64 bit, and be sure to note that Stateflow only supports a more limited list of compilers.
You will probably need one of:
  • sdk 7.1 (available for free download)
  • visual studio 2012 professional
  • visual studio 2010 professional
  • visual studio 2008 professional
You should start by giving the command than is listed in the error message:
mex -v -setup
I do not vividly understand what you mean. I think you mean that I have to download a compiler like sdk 7.1 and inestall it?
my windoes is 7- 64 bit.
when I try mex -v - setup I have recieved this error:
Error: Microsoft Visual Studio 2010 Professional Edition was not found by mex -setup.
The Microsoft Visual Studio 2010 Professional Edition linker is
required to build Intel C++ MEX-files. Please make sure that
Microsoft Visual Studio 2010 Professional Edition is installed
properly.
The command is
mex -v -setup
You put a space between the - and the setup
You will need to download and install one of the four compilers I listed.
many thanks for your help. the command of mex -v -setup is asking some questions, and none of my answers work correctly. I think I have to go thorough this:
(uninestall C++ 2010)
do you agree?
https://www.mathworks.com/matlabcentral/answers/95039-why-does-the-sdk-7-1-installation-fail-with-an-installation-failed-message-on-my-windows-system#answer_184539
But I would need to see the output of the setup attempt.

Sign in to comment.

Answers (0)

Categories

Asked:

on 17 Jul 2019

Commented:

on 17 Jul 2019

Community Treasure Hunt

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

Start Hunting!