max length in emxutil function names causing truncation

I have a question regarding the use of coder.cstructname. I’m using this to control the name of a field which is a dynamically allocated array of structures. The problem I have is the names of the emx util (*_emxutil.h) functions get truncated when the names I specify in the cstructname command are too long.
Example:
coder.cstructname(racc_output.TrackNameProfile.TrackNameEntity,'TrackNameEntity');
extern void c_emxEnsureCapacity_TrackNameEn(emxArray_TrackNameEntity *emxArray, int32_T oldNumel);
To avoid this truncation and the ‘c_’ at the beginning I have to use:
coder.cstructname(racc_output.TrackNameProfile.TrackNameEntity,' TrackNameEnti');
extern void emxEnsureCapacity_TrackNameEnti(emxArray_TrackNameEnti *emxArray, int32_T oldNumel);
Thanks in advance for your help! Joe

 채택된 답변

Joseph Wakeman
Joseph Wakeman 2015년 6월 18일
MATLAB got back to me with the answer:
For standalone code (i.e. DLL, LIB, and EXE), try increasing the maximum identifier length from the default of 32:
cfg = coder.config('lib');
cfg.MaxIdLength = 64; % or however long is needed
codegen ... -config cfg

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

질문:

2015년 6월 9일

답변:

2015년 6월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by