Why does Simulink code generator put #includes into my .c AND into the also #included .h?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I generate C code from a Simulink model. Since upgrading from 2021a to 2023b, I've noticed that Simulink redundantly #includes my _sharedutils headers containing function declarations both in myModelName.c AND in myModelName.h, even though it also #includes myModelName.h in myModelName.c.
Can anybody tell me why it would do that and how to make it stop?
0 Kommentare
Antworten (1)
Infinite_king
am 11 Dez. 2023
Bearbeitet: Infinite_king
am 11 Dez. 2023
Hi Simon Ahrens,
I understand that after upgrading to R2023b, C code generated from Simulink model contains unnecessary header files located in ‘my_sharedutils’ folder.
In Simulink, we can create models that can be reused in other models multiple times. Starting in R2022b, the code generator handles function and file packaging of generated code differently. For reusable library subsystems, the code generator produces subsystem code in the ‘slprj/target/_sharedutils’ folder. The subsystem code is shared across models as per model reference hierarchy.
This is indeed a valuable feature that helps minimize redundancy. You have the flexibility to control the names of functions, files, and the location of the shared library code, allowing you to customize it according to your needs. For more information on customization and setting up reusable library code, please refer to the following MATLAB documentation,
For more information on changes in each release, refer the following MATLAB documentation,
Hope this is helpful.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!