Simulink Coder: Unknown type name mxarray
Hello. I have created a custom S Function block that outputs the sum of a user definable number of inputs and it works in simulation. The next step for me is to generate C code from it using Simulink Coder. For now I don’t want to inline the S function, I just want to test its autocoded functionality.
When I generate the src and header files and try to build an executable in eclipse I get the following errors:
unknown type name ‘RTWSfcnInfo’ in mymodel.h
unknown type name ‘mxarray’ in mymodel.h,simstruct_def.h, simstruct_internal.h
unknown type name ‘_ResolveVarFcn’ ini simstruct_def.h
#error unrecognized use in simstruct_compond.h
#error unhandled case in simstruct_compond.h
#error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE in simstruc_compcond.h
I have looked for a solution online and for other people this was solved by including mex.h – I have tried it and it did not work.
Thanks in advance!Hello. I have created a custom S Function block that outputs the sum of a user definable number of inputs and it works in simulation. The next step for me is to generate C code from it using Simulink Coder. For now I don’t want to inline the S function, I just want to test its autocoded functionality.
When I generate the src and header files and try to build an executable in eclipse I get the following errors:
unknown type name ‘RTWSfcnInfo’ in mymodel.h
unknown type name ‘mxarray’ in mymodel.h,simstruct_def.h, simstruct_internal.h
unknown type name ‘_ResolveVarFcn’ ini simstruct_def.h
#error unrecognized use in simstruct_compond.h
#error unhandled case in simstruct_compond.h
#error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE in simstruc_compcond.h
I have looked for a solution online and for other people this was solved by including mex.h – I have tried it and it did not work.
Thanks in advance! Hello. I have created a custom S Function block that outputs the sum of a user definable number of inputs and it works in simulation. The next step for me is to generate C code from it using Simulink Coder. For now I don’t want to inline the S function, I just want to test its autocoded functionality.
When I generate the src and header files and try to build an executable in eclipse I get the following errors:
unknown type name ‘RTWSfcnInfo’ in mymodel.h
unknown type name ‘mxarray’ in mymodel.h,simstruct_def.h, simstruct_internal.h
unknown type name ‘_ResolveVarFcn’ ini simstruct_def.h
#error unrecognized use in simstruct_compond.h
#error unhandled case in simstruct_compond.h
#error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE in simstruc_compcond.h
I have looked for a solution online and for other people this was solved by including mex.h – I have tried it and it did not work.
Thanks in advance! simulink, embedded coder, s-function MATLAB Answers — New Questions