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
Ted Rimstidt
2018년 3월 19일
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?
Walter Roberson
2018년 3월 19일
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.
Ted Rimstidt
2018년 3월 19일
편집: Ted Rimstidt
2018년 3월 19일
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?
답변 (1개)
Walter Roberson
2018년 3월 19일
0 개 추천
Visual Studio 2017 is not supported in R2015b.
카테고리
도움말 센터 및 File Exchange에서 Simulink Compiler에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!