MATLAB: Do I receive a “NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’ ” error when I build the model in Real-Time Workshop 5.0.1 (R13)

5.05.0.1errorfatalfieldr13real timesimulink coderu1077unknownworkshop

When I build my model in Real-Time Workshop 5.0.1 (R13+) and 5.0 (R13), if I use Visual C++ 6.0, I receive the following error:
### Compiling System_Complet_LinksBreaked.c
cl -Ot -DUSE_RTMODEL -DMODEL=System_Complet_LinksBreaked -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -DHAVESTDIO -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32 -D_WIN32 System_Complet_LinksBreaked.c
System_Complet_LinksBreaked.c
System_Complet_LinksBreaked.c(1476) : error C2039: 'temp54' : is not a member of '_rtB_System_Complet_LinksBreak'
System_Complet_LinksBreaked.h(52) : see declaration of '_rtB_System_Complet_LinksBreak'
System_Complet_LinksBreaked.c(1476) : error C2198: 'sqrt' : too few actual parameters
System_Complet_LinksBreaked.c(1501) : error C2039: 'temp54' : is not a member of '_rtB_System_Complet_LinksBreak'
System_Complet_LinksBreaked.h(52) : see declaration of '_rtB_System_Complet_LinksBreak'
System_Complet_LinksBreaked.c(1631) : error C2039: 'temp54' : is not a member of '_rtB_System_Complet_LinksBreak'
System_Complet_LinksBreaked.h(52) : see declaration of '_rtB_System_Complet_LinksBreak'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
If I use LCC compiler, I get the following:
E:\1004553\System_Complet_LinksBreaked_grt_rtw>"D:\MATLAB6p5\rtw\bin\win32\gmake" -f System_Complet_LinksBreaked.mk ADD_MDL_NAME_TO_GLOBALS=1
D:\MATLAB6p5\sys\lcc\bin\lcc -c -FoSystem_Complet_LinksBreaked.obj -DUSE_RTMODEL -DMODEL=System_Complet_LinksBreaked -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0
[snip]
In both cases, I use the GRT Target and I am able to use "Generated code only" without any error message, but I am unable to build executables.

Best Answer

This is a bug in Real-Time Workshop 5.0.1 (R13+).
As a workaround, you can turn off 'Signal storage reuse' in the Advanced tab of the simulation parameters dialog for the model.