Why do I get error "'SS_OPTIO​N_CALL_TER​MINATE_ON_​EXIT' undeclared (first use in this function)" when trying to compile an S function ?

2 views (last 30 days)
Michael Urbanski
Michael Urbanski on 30 Jun 2021
Hello
I am trying to compile the source code of an s function with the option SS_OPTION_CALL_TERMINATE_ON_EXIT inside of the mdlInitializeSizes function. I have included simstruc.h at the start of the function and everything else was done properly to my knowledge, since the function compiled perfectly fine previously, before I tried to set any options. The code for mdlInitializeSizes is shown below:
static void mdlInitializeSizes(SimStruct *S)
{
/* Number of expected parameters--normally 0 */
ssSetNumSFcnParams(S, 0);
/* Return if number of expected != number of actual parameters */
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S))
return;
ssSetNumContStates( S, ntot); /* number of continuous states */
ssSetNumDiscStates( S, 1); /* number of discrete states */
ssSetNumInputs( S, ninpt); /* number of inputs */
ssSetNumOutputs( S, nout); /* number of outputs */
ssSetDirectFeedThrough(S, 1); /* direct feedthrough flag */
ssSetNumSampleTimes( S, 1); /* number of sample times */
ssSetNumRWork( S, 0); /* number of real work vector elements */
ssSetNumIWork( S, 0); /* number of integer work vector elements */
ssSetNumPWork( S, 0); /* number of pointer work vector elements */
ssSetNumModes( S, 0); /* number of mode work vector elements */
ssSetNumNonsampledZCs( S, 0); /* number of nonsampled zero crossings */
ssSetOptions(S,SS_OPTION_CALL_TERMINATE_ON_EXIT); /* general options (SS_OPTION_xx) */
}
The entire code is very long (~3000 lines) and includes other library files to compile, so I don't think I can include it, besides the rest of the code compiled fine in the past. I used to set:
ssSetOptions(S,0);
and the code compiled without any problems, but now I need to use some of the options to try and troubleshoot a different problem with the code. I would really appreciate some help, I am not sure why this isn't working, I thought the option names were recognised by the compiler.

Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by