Simulink Compiler Error for S-Function

I am trying to compile a Simulink s-function in Matlab 2016b and I am receiving the following 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/R2015b/win64.html
MATLAB must be restarted after the compiler is installed.
I have two compilers installed that are compatible with this package, MinGW and Microsoft Visual Studio 2017. When I type mex -setup into the Matlab command prompt I get the following output:
MEX configured to use 'Microsoft Visual C++ 2017 (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
To choose a different C compiler, select one from the following:
MinGW64 Compiler (C) mex -setup:'C:\Program Files\MATLAB\R2015b\bin\win64\mexopts\mingw64.xml' C
Microsoft Visual C++ 2017 (C) mex -setup:C:\Users\e0446159\AppData\Roaming\MathWorks\MATLAB\R2015b\mex_C_win64.xml C
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
Does anyone have any suggestions as to potential next steps? The Simulink file is rather complex and cannot be upgraded/downgraded to a different Matlab version. Thank you in advance for your help.

3 个评论

Hello, I have a very similar experience. I am trying to build a 2017b Simulink model and I only have MinGW available as a compiler now. I tested it with the example 'yprime', Matlab example and it appears to function. When I build the Simulink model I get the same error you shows that it cannot find an installed compiler. Any updates on your issues?
Ted Rimstidt: which MinGW release do you have installed? You would need MinGW 5.3 for R2017b for Simulink code generation, except that MinGW is not supported for Simulink Real Time.
I installed the MinGW 5.3 add-on available for 2017b. As far as Simulink Real Time is concerned I don't fully understand if that's needed for what I typically have done in the past. I'm not building real-time model dlls as far as I know. I was thinking the process I am doing was more related to building Simulink S-functions. Do I potentially need Microsoft Visual 2013 or higher?

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Simulink Compiler 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by