MATLAB: Do I receive an error when I manually compile code generated by Real-Time Workshop Embedded Coder 4.2 (R14SP2)

Embedded Coderreal_treal32_trtlibsrc.h

I am generating code for my model without support for floating-point numbers. Due to a Saturation block in the model, the generated code also depends on "rtlibsrc.h". I included this file in my project. However, when I compile the project, I receive error messages that indicate that "real_T" and "real32_T" data types are not defined.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The documentation of Real-Time Workshop Embedded Coder 4.2 (R14SP2) is missing information about setting macro definitions when manually compiling generated code.
In particular, for fixed-point-only code, use the macro definition "-DINTEGER_CODE=1" when compiling code manually.