MATLAB: Do I receive an error when building an MSVC project from Real-Time Workshop in Visual Studio 2005

simulink coder

I am building the attached model using the grt MSVC target. I am using the Team Edition of Visual Studio 2005. Opening the .mak file and building the project results in the following error:
1>d:\Applications\MATLAB\R2006b\toolbox\rtw\dspblks\c\dsprandsrc\randsrc_gz_r_rt.c(82) : error C2143: syntax error : missing ';' before '/'
1>d:\Applications\MATLAB\R2006b\toolbox\rtw\dspblks\c\dsprandsrc\randsrc_gz_r_rt.c(86) : error C2143: syntax error : missing ')' before ';'
1>d:\Applications\MATLAB\R2006b\toolbox\rtw\dspblks\c\dsprandsrc\randsrc_gz_r_rt.c(86) : error C2143: syntax error : missing ';' before '<='
1>d:\Applications\MATLAB\R2006b\toolbox\rtw\dspblks\c\dsprandsrc\randsrc_gz_r_rt.c(86) : error C2059: syntax error : ')'
Also, when using Visual Studio Express 2005 the error occurs. When using the professional version of MS Visual Studio 2005, this error does not occur.

Best Answer

The behavior seems to be a bug in some versions of Microsoft Visual Studio 2005.
In particular versions of Visual Studio 2005 (e.g., Visual Studio Express, Team Edition) the math.h file appears to contain an extra semi colon on line 303 of math.h.
#define fmodf(x,y) ((float)fmod((double)(x), (double)(y)))
#define logf(x) ((float)log((double)(x)));
#define log10f(x) ((float)log10((double)(x)))
If you delete the extraneous semi-colon, the model should build without error.
Note the MathWorks tests and supports only the Professional version of Visual Studio 2005. In the Professional version, the model code compiles without error. The math.h file in the professional version is correct.
This particular model is including some additional code for the signal processing blocks. This error would not occur if there were no signal processing blocks in the model.