- 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!