The issue is caused by the fact that when the S-function Builder block is taken out, the model is losing information about what source files other than the [s-function name].c would be associated with the MEX file that is given to the S-function block.
In order to the S-function block to know where to look for the _wrapper.c, you need to explicitly tell it in the *S-function modules field of the S-function block. More information about this field can be found here:
Best Answer