-I
Category
Pragma equivalent
None.
Purpose
Adds a directory to the search path for include files.
Defaults
See Directory search sequence for include files for a description of the default search paths.
Parameters
- directory_path
- The path for the directory where the compiler should search for the header files.
Usage
If -nostdinc or -nostdinc++ (-qnostdinc) is in effect, the compiler searches only the paths specified by the -I option for header files, and not the standard search paths as well. If -qidirfirst is in effect, the directories specified by the -I option are searched before any other directories.
If the -I directory option is specified both in the configuration file and on the command line, the paths specified in the configuration file are searched first. The -I directory option can be specified more than once on the command line. If you specify more than one -I option, directories are searched in the order that they appear on the command line.
The -I option has no effect on files that are included using an absolute path name.
Predefined macros
None.
Examples
xlc myprogram.c -I/usr/tmp -I/oldstuff/history