MATLAB: Do I need a C++ compiler when I use Real-Time Workshop 6.2 (R14SP2) just to generate code

ccodecompilationcompilerert_unix.tmffilefilesgenerategrt_unix.tmfonlysimulink codertmf

When I use Real-Time Workshop to generate C++ code, I receive the following build error:
The specified Real-Time Workshop target is configured to generate C++, but the C-only compiler, LCC, is the default compiler. To specify a C++ compiler, enter 'mex -setup' at the command prompt. To generate C code, click (Open) to open the Configuration Parameters dialog and set the target language to C.
I do not have a C++ compiler on my machine. My intent is to transfer the generated code to a different computer for compilation with other hand-written code. Why is a compiler required to just generate C++ code.

Best Answer

This bug has been fixed in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
The ability to generate C++ code without the need for compilation is not available in Real-Time Workshop 6.2 (R14SP2). When you select the 'Generate code only' option, Real-Time Workshop also generates a makefile and a bat file. The resulting generated code or makefile should be buildable as if the option was not selected.
To workaround this issue, set the model to use the UNIX TMF file. You can do this from the Real-Time Workshop pane of the Configuration Parameters dialog box by
1. Specifying grt_unix.tmf or ert_unix.tmf in the 'Template makefile' field.
2. Selecting the "Generate code only" option.
3. Clicking Generate Code.
Even though the TMF file is for UNIX based builds, Real-Time Workshop can still generate the code on a PC.