- 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.
Simulink Coder not making executable
20 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Suman
2023-2-13
Hi Andri,
To generate an executable in Simulink Coder, you have to configure some of the parameters as follows:
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
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!