Command-Line C Compiler Configuration

To configure the development computer for the C compiler using MATLAB® language, use this procedure.

The command mex -setup sets the default compiler for Simulink® Real-Time™ builds, provided the MEX compiler is a supported Microsoft® compiler. Use slrtsetCC -setup only if you require different compilers for MEX and Simulink Real-Time.

By default, the Microsoft Visual Studio® 2015 installer does not install the C++ compiler that Simulink Real-Time requires. To install the C++ compiler, perform a custom install and select the C++ compiler. If you have already installed Microsoft Visual Studio with the default configuration, rerun the installer and select the modify option.

  1. Install a supported C compiler on the development computer.

    For more about the Simulink Real-Time C compiler requirements, see

  2. In the Command Window, type:

    slrtsetCC setup

    The function queries the development computer for C compilers that the Simulink Real-Time environment supports. It returns output like the following:

    Select your compiler for Simulink Real-Time.
    [1] Microsoft Visual C++ Compilers 2008 Professional Edition (SP1) in 
        c:\Program Files (x86)\Microsoft Visual Studio 9.0
    [2] Microsoft Visual C++ Compilers 2010 Professional in 
        C:\Program Files (x86)\Microsoft Visual Studio 10.0
    [0] None
  3. At the Compiler prompt, enter the number for the compiler that you want to use. For example, 2.

    The function verifies that you have selected the required compiler:

    Verify your selection:
    Compiler: Microsoft Visual C++ Compilers 2010 Professional
    Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
    Are these correct [y]/n?
  4. Type y or press Enter.