Main Content

Include paths (-I)

Specify paths to folders containing include files

Since R2023b

Description

The option with this name is available only in the Polyspace Platform (Polyspace Test) user interface. In the standard Polyspace® user interface, you add include paths during project creation. For more information, see Add Source Files for Analysis in Polyspace User Interface.

Specify paths to folders containing include files.

Polyspace looks in the specified folders for header files included with #include statements in sources. This option is equivalent to the command-line option -I. This option applies to both static analysis and dynamic testing. You can specify either an absolute path to the header files or a path relative to the project location.

Set Option

User interface (Polyspace Platform, desktop products only): In your project configuration, the option is in the Project tab.

Command line and options file: Use the command -I. See Command-Line Information.

Why Use This Option

Use this option to specify where you keep your header files. You can then include the headers to your source code.

Settings

Specify the absolute or relative path to the folders that contains your header files. To add a folder, do one of the following:

  • Click and enter the path to the folder containing your header files. Polyspace resolves the relative paths relative to the location of the project file (*.psprjx).

  • Browse to the location by using the Add folder () or Add folder as relative path () button.

If you want to include the subfolders of the specified folder recursively, select the checkbox in the Subfolders column.

During static analysis or project build, the include paths are used for header file lookup in the order in which you add them. As a result, if a header file with a specific name exists in multiple locations, the file in the location added earlier gets used during project build or static analysis.

Tips

You can use project variables or system environment variables as shorthands in the include folder paths. If you share the project with another user who has the include folders in a different root location, utilizing environment variables can help ensure that the project stays in sync with include folder paths. For more information, see:

Command-Line Information

To use this option at the command line, you can either use the option directly or append the option in an options file.

Parameter: -I
Default: None
Value: file (Use -I multiple times for multiple files)
Example (Bug Finder): polyspace-bug-finder -I /com1/inc -I /com1/sys/inc
Example (Code Prover): polyspace-code-prover -I /com1/inc -I /com1/sys/inc
Example (Bug Finder Server): polyspace-bug-finder-server -I /com1/inc -I /com1/sys/inc
Example (Code Prover Server): polyspace-code-prover-server -I /com1/inc -I /com1/sys/inc

Version History

Introduced in R2023b