Why does't MATLAB R2016b recognize a C Compiler?
3 ビュー (過去 30 日間)
古いコメントを表示
I know this Question has already been asked several times but I still don't manage to solve it. I run Matlab R2016b on Windows 10.
Everytime I compile a SimuLink Program I get the following error message :
"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:
MATLAB must be restarted after the compiler is installed.
Once you have a supported compiler installed, either select it to be the MEX compiler or override the MEX compiler with: slrtsetCC -setup"
Here is what I did:
- I installed Microsoft Visual Studio Professional 2015 and have now
- Microsoft Visual C++ 2015 and also
- Microsoft .NET Framework 4.6.1 SDK on my System (both are listed in the above link).
- When I run slrtsetCC -setup in the MATLAB Command Window, I get the following:
Select your compiler for Simulink Real-Time.
[1] Microsoft Visual C++ Compilers Professional 2015 in C:\Program Files >>(x86)\Microsoft Visual Studio 14.0
[0] None
Compiler:1
Verify your selection:
Compiler: Microsoft Visual C++ Compilers Professional 2015
Location: C:\Program Files (x86)\Microsoft Visual Studio 14.0
Are these correct [y]/n?y
Done...
Where I selected Compiler: 1 and verified ( y ).
- When I now try compiling my Program, I still get the same error message that there is no Compiler detected (restarting MATLAB doesn't change that).
- What could also be helpful to answer my question:
When I type myCCompiler = mex.getCompilerConfigurations('C','Selected'), I get
myCCompiler =
0×1 CompilerConfiguration array with properties:
Name
Manufacturer
Language
Version
Location
ShortName
Priority
Details
LinkerName
LinkerVersion
MexOpt
Here I should be able to see the properties of the selected C Compiler, but it doesn't show anything.
When I type mex -setup, I get
Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install
MinGW-w64 Compiler. For more options, visit http://www.mathworks.com/support/compilers/R2016b/win64.html.
Which is the same link as before..
0 件のコメント
採用された回答
Kushagr Gupta
2017 年 3 月 15 日
There could be a possibility that while installing Visual Studio, "Typical" setup option was chosen, which does not install the Visual C/C++ compiler by default. This is seen in Microsoft's documentation:
To resolve this issue, re-run the Visual Studio 2015 installer again and choose to perform a "Custom" setup. Then during installation, make sure to enable "Visual C++" under "Programming Languages".
Also, the function 'slrtsetCC' is for the Simulink Real-Time product which is independent of Simulink/Enbedded Coder products.
Moreover, the verbose mode for "mex -setup" will be helpful in order to see what is going on under the hood. This can be done by including the -v flag, shown as follows:
>> mex -v -setup
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!