Simulink Coder not making executable
이전 댓글 표시
Hi,
I'm trying to make turn a model into executable C code but I'm not getting a executable file.
In the Matlab Command Window I have tried the following
mex -setup
MEX configured to use 'Microsoft Visual C++ 2019 (C)' for C language compilation.
To choose a different C compiler, select one from the following:
MinGW64 Compiler (C) mex -setup:C:\MathWorks\MATLAB\R2022a\bin\win64\mexopts\mingw64.xml C
Microsoft Visual C++ 2019 (C) mex -setup:C:\xx\xx\AppData\Roaming\MathWorks\MATLAB\R2022a\mex_C_win64.xml C
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
>> mex -setup:C:\MathWorks\MATLAB\R2022a\bin\win64\mexopts\mingw64.xml C
Renamed options file 'C:\xx\xx\AppData\Roaming\MathWorks\MATLAB\R2022a\mex_C_win64.xml' to 'C:\xx\xx\AppData\Roaming\MathWorks\MATLAB\R2022a\mex_C_win64_backup.xml'.
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
I have the following settings in Simulink coder

The code builds and creates a folder but that folder only has the c and h files but no msvc folder with the executable or Visual Studio Solution.
Any ideas how to resolve this issue?
I have tried following the guide at Generate C Code from Simulink Model - MATLAB & Simulink - MathWorks Nordic to no avail.
답변 (1개)
Suman
2023년 2월 13일
0 개 추천
Hi Andri,
To generate an executable in Simulink Coder, you have to configure some of the parameters as follows:
- The parameter "Code Generation" -> "Generate code only" must be unchecked which is already done in your case.
- The parameter "Code Generation" -> "Build process" -> "Makefile configuration" -> "Generate makefile" must be checked.
If you cannot find the "Generate makefile" option, just open the Configuration parameters and search for it in the search window located on top.
If the "Generate makefile" option is unchecked, no makefile will be generated and the compiler will not have any instructions to build the executable, hence no executable is generated.
I hope this information is helpful to you.
Cheers,
Suman
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
