Compilers

When do I need to install a C/C++ compiler?

Twin Activate comes with and installs a default compiler, TCC, which is applicable for simple use cases such as compiling a C Custom block.

For more complex use cases, such as those involving Modelica blocks and the creation of an FMU, the installation of a C/C++ compiler is required.

How do I check if a C/C++ compiler is installed?

To view the compiler installed on your system, from the OML command window, enter vssGetCompilerName()

If you do not have a C/C++ compiler installed, you may get the error message: Unsupported Visual C++ Target Option

During some use cases, for example, simulation of Modelica models or FMI import or export, the software issues an error if unable to detect a C++ compiler installed on the system. To correct the error, install a supported Microsoft Visual Studio C++ compiler.

How do I select a C/C++ compiler?

You can select a compiler in the user interface and with API functions.

In the user interface, open File > Preferences, and then go to Twin Activate > Paths. Select an option from the C compiler drop-down list.

The API functions are:
  • vssGetCompilerNames: Lists all available compilers
  • vssGetCompilerName: Shows the currently selected compiler
  • vssSetCompiler: Sets a specific compiler

What compiler is required for models that include Modelica and Twin Activate blocks?

See the list of supported compilers for Windows and Linux in the System Requirements.