Specify C or C++ code generation.
Category: Code Generation
Default:
C
C
Generates C code and places the generated files in your build folder.
C++
Generates C++ code and places the generated files in your build folder.
On the Code Generation > Interface pane, if you additionally set the Code interface
packaging parameter to C++ class
, the build
generates a C++ class interface to model code. The generated interface encapsulates
required model data into C++ class attributes and model entry point functions into C++
class methods.
If you set Code interface packaging to a value other than
C++ class
, the build generates C++ compatible
.cpp
files containing model interfaces enclosed within an
extern "C"
link directive.
You might need to configure the Simulink® Coder™ software to use a compiler before you build a system.
Selecting C++
enables and selects the value C++
class
for the Code interface packaging parameter on the Code Generation > Interface pane.
Parameter:
TargetLang |
Type: character vector |
Value:
'C' | 'C++' |
Default:
'C' |
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No impact |