0

I have a controller block designed in Matlab R2013b simulink. I want to generate a c/c++ code of the block by using the 'Build Model' function. However, I keep getting this error:

"An installed compiler was not detected. Certain simulation modes, as well as host-based coder builds require that a compiler be installed. Please install one of the supported compilers for this release as listed at: http://www.mathworks.com/support/compilers/R2013b/win64.html MATLAB must be restarted after the compiler is installed."

I downloaded Microsoft Windows SDK for Windows 7 and .NET Framework 4 (supported and Compatible Compilers – Release 2013b). However I am still getting the same error.

Please can anyone suggest a solution?

7
  • What version of Visual Studio have you got installed? Commented Feb 19, 2014 at 16:37
  • Run mex -setup and select the appropriate compiler. Commented Feb 19, 2014 at 16:43
  • @TimBergel, I have visual studio 2005 Remote degubber. However, I use codeblocks for my c/c++ development Commented Feb 19, 2014 at 19:03
  • @EsuabomDavidDijemeni Neither visual studio 2005 or codeblocks appears to be in the list of supported compilers in the link you posted in your question. And a remote debugger is not a compiler of course. So I think you need a different compiler, I'm afraid. Commented Feb 19, 2014 at 19:11
  • @TimBergel I see your point. Sorry my bad. I am using GNU GCC Compiler. Do you think I should change my compiler to Microsoft Visual C++ 2010 ? Commented Feb 19, 2014 at 19:43

1 Answer 1

1

Step 1- download the Microsoft Windows SDK 7.1 from http://www.mathworks.co.uk/support/compilers/R2012a/win64.html.

Step 2 - Open the command line and type mex -setup

Step 3 - type y to locate installed compilers

Step 4 - Type the number in front of the Microsoft Software Development Kit 7.1 (for me it was 1)

Step 5 - type y to verify your choice

Step 6 - Open matlab and use the 'Build Function' to convert your simulink block to c/c++ code (For me it worked)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.