Documentation

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 need to specify different compilers for MEX and Simulink Real-Time.

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

    For more about the Simulink Real-Time C compiler requirements, see www.mathworks.com/support/compilers/current_release.

  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
    
    Compiler:
  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 to verify the selection.

Was this topic helpful?