Compiler settings for development computer environment



slrtsetCC setup queries the development computer for installed C compilers supported by the Simulink® Real-Time™ environment. You can then select the C compiler.

In a future release, the slrtsetCC and slrtgetCC functions will be removed.

Use the mex command. 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 must specify different compilers for MEX and Simulink Real-Time. The slrtsetCC function does not support the Visual Studio 2019 compiler. To set up this compiler, see Select Visual Studio 2019 Compiler.

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.


slrtsetCC 'type' 'location' sets the compiler type and location.

To return to the default MEX compiler from a setting by slrtsetCC, type slrtsetCC 'VisualC' '', setting the compiler location to the empty character vector.


Select Compiler

slrtsetCC ('setup')
Select your compiler for Simulink Real-Time.

[1] Microsoft Visual Studio 2015 in C:\Program Files (x86)\Microsoft Visual Studio 14.0\

[0] None

Compiler: 1

Verify your selection:

Compiler: Microsoft Visual Studio 2015
Location: C:\Program Files (x86)\Microsoft Visual Studio 14.0\

Are these correct [y]/n? y


Set Compiler Specification

slrtsetCC ('VisualC','C:\Program Files (x86)\Microsoft Visual Studio 14.0\')

Select Visual Studio 2019 Compiler

The slrtsetCC function does not support the Visual Studio 2019 compiler. To setup the Visual Studio 2019 compiler for Simulink Real-Time, set the Simulink Real-Time compiler specification to the empty character vector and select the compiler by using mex -setup.

slrtsetCC ('VisualC','')
mex -setup

Input Arguments

collapse all

type must be VisualC, representing the Microsoft Visual Studio C compiler.

Example: 'VisualC'

Data Types: char

Data Types: char | string

Introduced in R2014a