Simulink cannot find an installed C compiler even after running mex -setup

2 Ansichten (letzte 30 Tage)
Max Eliaser
Max Eliaser am 27 Jul. 2015
Beantwortet: Abdul am 5 Feb. 2018
Using Matlab/Simulink R2013a here. Operating system is Windows 7 64-bit. I'm running the 64-bit version of Matlab. When I try to run my Simulink model, I get the following error:
The way to fix this is supposedly to install the Microsoft SDK version 7.1, which I have done. The compiler is in C:\Program Files (x86)\Microsoft Visual Studio 10.0.
The "mex -setup" command now detects the compiler and appears to work correctly. This is what the "mex -setup" output looks like from the Matlab console:
However, this makes no difference when I try to run my simulink model. I still get the error shown in the screenshot above.
I found this question already:
And this bug report:
My problem looks almost identical (Simulink not finding a C compiler, "mex -setup" appears to work but doesn't actually help.) The only difference is I'm using a different version of Visual Studio. I tried applying the patch attached in the bug report, and it unfortunately does not fix my problem. I appear to have a very similar problem to bug 931218 but the solution to that bug is not fixing my issue! Unless I'm applying the patch incorrectly. :)
Digging a little deeper, the "mex -setup" output indicates that a configuration file has been written to C:\Users\MELIASE\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat. So I decided to have a look at that Batch script a little closer. Here are its contents on my system:
I don't know exactly what this script is supposed to do but it looks like it sets the PATH and LIB environment variables so that the compiler can run, and then sets the COMPILER environment variable to the compiler executable itself. It all seems to work:
As you can see, the COMPILER environment variable is correctly aliased to the compiler executable. So I'm guessing that that batch script outputted by "mex -setup" is valid, and the problem lies elsewhere. I'm stumped, does anyone know of anything else I could try?

Antworten (1)

Abdul
Abdul am 5 Feb. 2018
Hi,
Were you able to find the solution? I am having a similar problem.
Thanks ! Best regards

Kategorien

Mehr zu Troubleshooting in MATLAB Compiler SDK finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by