Main Content

Generate example main

Example C/C++ main file generation

Description

App Configuration Pane: Advanced

Configuration Objects: coder.CodeConfig | coder.EmbeddedCodeConfig

Example C/C++ main file generation.

An example main function is a template to help you to write a C/C++ main function that calls generated C/C++ code. See Incorporate Generated Code Using an Example Main Function.

Settings

Generate, but do not compile, an example main function

This value is the default value.

The code generator generates an example C/C++ main function but does not compile it.

Do not generate an example main function

The code generator does not generate an example C/C++ main function.

Generate and compile an example main function

The code generator generates an example C/C++ main function and compiles it to create a test executable. This executable does not return output.

If the GenCodeOnly parameter is true, the code generator does not compile the C/C++ main function.

Programmatic Use

Property: GenerateExampleMain
Values: 'GenerateCodeOnly' | 'DoNotGenerate' | 'GenerateCodeAndCompile'
Default: 'GenerateCodeOnly'

Version History

Introduced in R2015a