Problem with Real time Workshop Embedded Coder and Compiler (Mex -setup) in Build Subsystem

4 views (last 30 days)
Hi,
i have a problem when i build subsystem in simulink, for get the code in c of archive the simulink, with real time workshop embedded coder, in Matlab R2010a.
i have installed Microsoft Visual C 2010 Express in C:\Program Files (x86)\Microsoft Visual Studio 10.0, and i work in windows 7 at 64 bits.
i selected this option in mex -setup, for select the compiler, but i come out this mensage in Diagnosing Simulation Errors, later of give right click in the subsystem in the option real time workshop, in the option build subsystem for that get the code of subsystem
*_Unable to locate a Visual C/C++, Watcom, Borland, Intel, or LCC compiler. Please define one of the following environment variables:
Real-Time Workshop builds with Microsoft Visual C on 64 bit windows require that the compiler be installed. At least one of these environment variables is expected to be set: VS90COMNTOOLS VS80COMNTOOLS VS90COMNTOOLS
Please check your Microsoft Visual C installation and ensure the appropriate environemnt variable is set. set WATCOM=<WatcomPath> set BORLAND=<BorlandPath> or you can run "mex -setup" to configure the location of your compiler or to use LCC compiler shipped with MATLAB._*
and in the command window come out this mensage at final: ### Real-Time Workshop build procedure for model: 'Subsystem' aborted due to an error. ??? Subsystem build failed
i don't understand why i come out this, when i have installed the compiler and i selected this option in mex -setup for the compiler. what do i configure in matlab or simulink for that don't come out this mensage? and the build subsystem come out good, for get the code in c
thanks for your answers and collaboration

Answers (3)

Melih
Melih on 30 Jul 2012
I encountered the same problem. After a couple of hours, I noticed that Simulink product family R2010a does NOT support Microsoft Visual C++ 2010 Express, although Matlab product family R2010a supports it (Check the list for the supported compilers: http://www.mathworks.com/support/compilers/R2010a/win64.html#simulink). The solution is installing Microsoft Visual C++ 2008 Express and Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1, too (as explained here: http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L). After having selected Microsoft Visual C++ 2008 Express as compiler, I was able to generate code from Simulink models.

Kaustubha Govind
Kaustubha Govind on 16 May 2012
When you ran "mex -setup", did MATLAB pick up your compiler automatically, or did you enter the path manually? It seems like you may have done the latter. Which version of MSVC did you select?
  2 Comments
Jose Fonseca
Jose Fonseca on 16 May 2012
When i ran mex -setup i enter the path manually, i believe
me come out two options to run mex -setup, [1] Microsoft Visual C 2010 Express in C:\Program Files (x86)\Microsoft Visual Studio 10.0 and [0] none.
i select the option one.
Kaustubha Govind
Kaustubha Govind on 18 May 2012
Not sure what, but there's definitely something not installed correctly with your Visual Studio. MATLAB should be able to pick it up automatically, without you entering the path manually.

Sign in to comment.


Walter Roberson
Walter Roberson on 16 May 2012
I notice that you are now using C++ 2010 Express but before you were using C++ 2010 Professional. In R2010a, both C++ 2010 Express and Professional require the patch that I mentioned in your previous question http://www.mathworks.com/matlabcentral/answers/38367-configure-compiler-c-wiht-mex-setup-at-64-bits-in-win-7
  1 Comment
Jose Fonseca
Jose Fonseca on 16 May 2012
yes, you have razon, i installed the patch that you mentioned, then now when i ran mex -setup, i can select the compiler that i have installed, MSVC 2010 Express.
But now, in the archive the Simulink when i ran the option build subsystem, for get code in c, me come out the mensage that i put in my question, and me say that Subsystem build failed in command window

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!