How do I run the C code generated fomr a simulink model that contains S function
7 次查看(过去 30 天)
显示 更早的评论
I am working on C code generation from Simulink model. Some subsystems of the model were built using S function. After I generate code from the modle with "non-inlined S function" checked, I passed the "model check" and successfully generated the C code (matlab2014a 32bit). However, when I collect all the .c and .h file and try to run in Dev C++. I always got the error message :
"error Unrecognized use.",
"error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE" ,
"[Error] unknown type name 'mxArray'"and "[Error] unknown type name 'RTWSfcnInfo'".
It seems the simstruc.h must be included as required from the generated C code, but it is conflicting with some files. Is there any solution to this problem, such that I can run the generated C code. I tried the case without S function , everything was as expected
0 个评论
回答(1 个)
Sainath Varikuti
2015-5-13
It is possible that dependent header files are missing during compilation. Use pack and go functionality to package all the necessary files and dependents by using the following command before compiling it in external IDE.
set_param(your_model, 'PostCodeGenCommand','packNGo(buildInfo, {''packType'' ''hierarchical''})');
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!