Additional source files - Source files to compile and link with the generated code - MATLAB (original) (raw)

Main Content

Source files to compile and link with the generated code

Description

App Configuration Pane: Custom Code

Configuration Objects: coder.MexCodeConfig | coder.CodeConfig | coder.EmbeddedCodeConfig

The Additional source files parameter specifies the source files to compile and link with the generated code. Enter or select the files to include.

If you do not specify a folder, the build process searches for the source files first in the current folder, and then in the include folders that you specify in Additional include directories.

If source files with the same name occur in multiple folders on the search path, the build process might use a different file than the file that you specified. For example, suppose that you specify foo.cpp as a source file. Iffoo.c and foo.cpp are both on the search path, you cannot be sure whether the build process uses foo.c orfoo.cpp.

Settings

String array

Files to compile and link with the generated code.

Programmatic Use

**Property:**CustomSource
Values: ' ' | string array cell array of character vectors character vector

Version History

Introduced in R2011a

expand all

Specifying multiple file names, paths, or reserved names in code configuration objects by using character vectors or string scalars that have delimiters produces an error. Use string arrays and a cell array of character vector instead. For example, cfg.CustomSource = ["mySrc1.c","mySrc2.c"]; orcfg.CustomSource = {'mySrc1.c','mySrc2.c'};.

Specifying multiple file names, paths, or reserved names in code configuration objects by using character vectors or string scalars that have delimiters produces a warning and will be removed in a future release. Use string arrays and a cell array of character vector instead. For example, cfg.CustomSource = ["mySrc1.c","mySrc2.c"]; or cfg.CustomSource = {'mySrc1.c','mySrc2.c'};.

In a future release, specifying multiple file names, paths, or reserved names in code configuration objects by using character vectors or string scalars that have delimiters will be removed. Use string arrays and a cell array of character vectors instead. For example, cfg.CustomSource = ["mySrc1.c","mySrc2.c"]; or cfg.CustomSource = {'mySrc1.c','mySrc2.c'};.