Code generation error with Re-usable storage class
조회 수: 3 (최근 30일)
이전 댓글 표시
The struct pointer is defined in the external c code and we are trying to import and reuse the same in auto code using custom storage class Reusable
But we encountered with the following error,
Reusable CSC specification can not be honoured when function prototyping control is enabled.
Any work around to resolve this issue will be appreciated.
Thanks in advance.
댓글 수: 0
답변 (1개)
Raag
2025년 3월 7일
Hello Phani,
The error you're encountering occurs because when function prototyping is enabled, MATLAB Coder expects complete function prototypes. This conflicts with the "Reusable" storage class you’re trying to use for your externally defined struct pointer. In simple terms, the code generator can’t reconcile a reusable external structure with the strict function prototypes it's set to enforce.
One straightforward workaround is to disable function prototyping in your code generation configuration.For example, if you're using MATLAB Coder, you can modify your configuration as follows:
cfg = coder.config('exe');
cfg.EnableFunctionPrototyping = false;
codegen yourFunction -config cfg
This change tells the code generator not to enforce full function prototypes, allowing your Reusable storage class to be honoured.
For a better understanding of the above solution, refer to the following MATLAB documentation:
1. Configure Code Generation and Build Settings: https://www.mathworks.com/help/coder/ug/build-setting-configuration.html
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!