Interfaces
FAQ I06 - How do I setup Matlab to be used with the Microsoft Visual C++ compiler (Windows)?
Category: Simcenter Amesim
Topic: Interfaces
Access Level: End User
Publish Date: December 2008
Question
How do I set up Matlab to be used with the Microsoft Visual C++ compiler (Windows)?
Answer
Overview:
Before compiling (for the first time) a Simcenter Amesim model that contains a Matlab-Simulink interface block, you must indicate to Matlab that the Microsoft Visual C++ compiler will be used to generate the S-function. The Simcenter Amesim model will not compile successfully until this procedure is performed once first. This FAQ is only intended for Windows users.
Step-by-step solution:
The solution is to anticipate this compilation problem, by typing a specific command to set up the appropriate compiler.
Procedure
Make sure that the Matlab path is included in the PATH environment variable on the machine.
Open a Matlab command window, or a console window (Linux), or a DOS command window (Windows).
Type
mex –setupand press Enter.
The following message shows the available compilers that are automatically detected:
- Click on the desired Microsoft Visual C++ compiler version.
Results
The appropriate Microsoft Visual C++ compiler is correctly set up, and your Simcenter Amesim model will compile successfully.
Note
If this procedure is not performed once before compiling the Simcenter Amesim model that contains Simulink interface blocks, the compilation will hang. In this case, we suggest you to refer to FAQ I02 - Why is the compilation window blocked during the first use of the Simcenter Amesim-Simulink interface?.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.faqs/xid1847524 · retrieved 2026-07-17