5) Select Microsoft Visual C++ 2017 (C)
6) Copy the attached timestwo.c file to an empty directory to make sure that you can mex. Then, execute in MATLAB
7) If the mex command works without error, you can now use Simulink Real-Time with the Visual Studio 2017 compiler. If you are using Speedgoat libraries, they can now be installed. Make sure that you install the latest Speedgoat libraries.
Note:In R2016b and R2017a, do NOT execute "slrtsetCC setup" to select Visual Studio 2017 as the compiler for SLRT because this may create an unusable MEX setup. Only "mex -setup" is required in R2016b and R2017a. If "slrtsetCC setup" has been called, delete the HostEnvSettings.xml file in the directory returned by executing "xpcprefdir" in the Command Window.
Troubleshooting: If you encounter build issues with your specific Simulink Real-Time model, check whether you can build with increasingly complex models. For example, begin by