I

Option Type Default Value #pragma options C C++
-flag - - x x

Syntax

    -Idirectory 

Purpose
Specifies an additional search path if the file name in the #include directive is not specified using its absolute path name.

Notes
The value for directory must be a valid path name (for example, /u/golnaz, or /tmp, or ./subdir). The compiler appends a slash (/) to the directory and then concatenates it with the file name before doing the search. The path directory is the one that the compiler searches first for #include files whose names do not start with a slash (/). If directory is not specified, the default is to search the standard 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. See Directory Search Sequence for Include Files Using Relative Path Names for more information about searching directories.

If you specify a full (absolute) path name on the #include directive, this option has no effect.

Example
To compile myprogram.c and search /usr/tmp and then /oldstuff/history for included files, enter:

    xlC myprogram.c -I/usr/tmp -I/oldstuff/history


List of Batch Compiler Options and Their Defaults
idirfirst Compiler Option
Equivalent Batch Compile-Link and Incremental Build Options