- What you are trying to do
- How you are trying to do it
- At what stage of the process you encounter the error
Problem with compiler C to use int16_t type for translation in Q15 format
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
I have a problem with compiler C. I have this error message
Error using legacycode.LCT.legacyCodeImpl
The data type "int16_t" is neither a built-in data type, nor defined by
a Simulink.AliasType, Simulink.NumericType, Simulink.Bus object, or an
enumerated data type:
--> int16_t y1 = ControlloDig(int16_t u1)
Error in legacy_code (line 101)
[varargout{1:nargout}] = legacycode.LCT.legacyCodeImpl(action,
varargin{1:end});
Error in Discretizza_controllo_generazione_sfun (line 77)
legacy_code('sfcn_cmex_generate', def);
I did a function that works in Q15 format but, when I use the script to compile it, Matlab shows an error on the data type "int16_t". If you need the other files i can upload them.
댓글 수: 0
답변 (2개)
Sebastian K
2017년 5월 26일
Hi there,
I am afraid it will not be possible to provide a very helpful answer based on the limited information you have provided. The error message itself is not quite useful. Ideally you should provide a detailed explanation of:
Just by looking at the error message, I am guessing that you are probably trying to use the Legacy Code Tool to build a C MEX S-function from some hand-written C code.
The main issue looks like the "int16_t" data type is not defined. One potential reason for this could be that you are missing a header file in your C code that contains the data type definition. Try adding the following "include" directive to your C code.
#include <tmwtypes.h>
I hope this helps.
Sebastian
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!