MATLAB: Do I receive errors when building a model which contains an S-function with MAT-file API in Simulink

fileheaderheader filesheader-filesimulink coder

I have a C-MEX S-function that I use to read data from a MAT-file.
I use commands such as: matOpen, matGetVariable, in my C-code.
I also include the header file needed for using those functions, by using the command:
#include "mat.h"
When I build the model using GRT target, I receive error messages during my build process.
The error messages are related to a contention between header file, for example:
d:\Applications\MATLAB71\extern\include\matrix.h(144) : error C2371: 'mxArray' : redefinition; different basic types
D:\Applications\MATLAB71\rtw\c\libsrc\rt_matrx.h(41) : see declaration of 'mxArray'

Best Answer

The ability to generate code from a model that has C MEX S-functions with MAT-file API functions is not available in Real-Time Workshop.
There are no workarounds.