Hello everyone,
I have a simulink working simulink schema in which there are some s-function, I want to export this code in c++ and compile it. I already tried to export and compile a simple schema and it works, but when i try to compile the exported code of my project I get a lot of errors like
error: #error Unrecognized use
error: #error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE
error: #error Unhandled case
error: ‘mxArray’ does not name a type mxArray **dlgParams; /* The S-function parameters
error: ‘mxArray’ has not been declared mxArray **)
error: ‘mxArray’ does not name a type mxArray *propVal;
error: ‘RTWSfcnInfo’ does not name a type; did you mean ‘RTWLogInfo’? RTWSfcnInfo sfcnInfo
The main settings that i used are:
Code generation system target file --> grt.tlc
language --> C++
Pack code and artifact --> <name_zip>
Tool chain GNU gcc/g++ | gmake (64-bit Linux)
default parameter behavior --> tuanble
code interface packaging --> nonreusable function
external mode --> chcked
standar math library --> c++ 03(ISO)
single output/update function --> checked
i used a fixed step size solver
Im using Ubuntu 18.
The source is generated succesfully the problem is when i try to compile the code.
Once the code is generate I get a zip folder with all the sources and also some external header file that I include when I make the CMakeLists.txt. I also tryied to compile directly the code with the .mk file but also I get a bounch of errors. The problem is realated with the s-function because I built a simple simulink schema with a source an s-function that implements a dynamical model and an output and when i generate the code and compile it I get the same errors. I also tryied to make a simple schema without s-function and this works. So is there any settings for the s-function to be exportable?