1.The directory of the source file containing the #include.

2.The directory named in the -Ioption.

3.The standard include directories /opt/aCC/include and /usr/include.

For #include files that are enclosed in angle brackets (< >), the preprocessor searches in the following order:

1.The directory named in the -Ioption.

2.The standard include directories /opt/aCC/include and /usr/include.

NOTE: The current directory is not searched when angle brackets (< >) are used with #include.

Example:

The following example directs the compiler to search in the directory include for #include files.

aCC -I include file.C

-I-

[-Idirs] -I- [-Idirs]

[-Idirs]indicates an optional list of -Idirectoryspecifications in which a directory name cannot begin with a hyphen (-) character.

The -I-option allows you to override the default -Idirectorysearch-path. This feature is called view-pathing. Specifying -I-serves two purposes:

1.It changes the compiler’s search-path for quote enclosed (" ") file names in a #include directive to the following order:

a.The directory named in the -Ioption.

b.The standard include directories /opt/aCC/include* and /usr/include. The preprocessor does not search the directory of the including file.

2.It separates the search-path list for quoted and angle-bracketed include files.

Angle-bracket enclosed file names in a #include directive are searched for only in the

-Idirectories specified after -I-on the command-line. Quoted include files are searched for in the directories that both precede and follow the -I-option.

The standard aCC include directories (/usr/include and /opt/aCC/include*) are always searched last for both types of include files.

Usage:

View-pathing can be particularly valuable for medium to large sized projects. For example, imagine that a project comprises two sets of directories. One set contains development versions of some of the headers that the programmer currently modifies. A mirror set contains the official sources.

Without view-pathing, there is no way to completely replace the default -Idirectorysearch-path with one customized specifically for project development.

With view-pathing, you can designate and separate official directories from development directories and enforce an unconventional search-path order. For quote enclosed headers, the preprocessor can include any header files located in development directories and, in the absence of these, include headers located in the official directories.

If -I-is not specified, view-pathing is turned off. This is the default.

Examples:

With view-pathing off, the following example obtains all the quoted include files from dir1 only if they are not found in the directory of a.C and from dir2 only if they are not found in dir1. Finally, if necessary, the standard include directories are searched. Angle-bracketed include files are searched for in dir1, then dir2, followed by the standard include directories.

46 Command-Line Options