Skip to main content
Documentation
CONTENTS

C Compiler Configuration

C Compiler Configuration

C Compiler

Simulink Real-Time lets you automatically create real-time applications from Simulink models. This automated C code generation process requires a valid Visual Studio compiler installation on your development PC.

The following table shows which versions of Visual Studio compilers are supported by Simulink® Real-Time™ in which MATLAB releases:

MATLAB release

R2016b

R2017a

R2017b

R2018a

R2018b

R2019a

Supported compilers

VS2012

VS2013

VS2015

VS2017

VS2013

VS2015

VS2017

VS2015

VS2017

In case of compiler issues contact MathWorks support.

Please ensure you have a compatible C/C++ compiler installed.

A list of all supported compilers is available at: www.mathworks.com/support/compilers.

For previous releases please visit: www.mathworks.com/support/compilers/previous_releases.html.

Set the compiler

The mex -setup command sets the default compiler for Simulink Real-Time builds, provided that the MEX compiler is supported by MathWorks.

We recommend to use the same compiler for MEX-file compilation and for Simulink Real-Time builds. To enable this option use the following command:

slrtsetCC ('VisualC', '')

By using the mex -setup command, the compiler for Simulink Real-Time builds will now be the same.

Instructions on how to configure a compiler: Command-Line C Compiler Configuration or Command-Line C Compiler Configuration (web)