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 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 ('VisualC','')
    mex -setup

    The function queries the development computer for C compilers that the Simulink Real-Time environment supports.