2.3.4. Specifying search paths

These options enable you to specify the directories to search for included files.

Also, see PCH processing options for a description of the options you can use to control the processing of PCH files.

Include file options

The precise search path varies according to the combination of options you select, and whether the include file is enclosed in angle brackets or double quotes. See Included files for full details of how these options work together:

--preinclude filename

Includes the source code of the specified file at the beginning of the compilation. This can be used to establish standard macro definitions, for example. The filename is searched for in the directories on the include search list.

-I, directory

Adds the specified directory directory, or comma-separated list of directories, to the list of places that are searched to find included files. If you specify more than one directory, the directories are searched in the same order as the -I options specifying them.

See Included files for full details on how the compiler handles include files.

--kandr_include

Ensures that Kernighan and Ritchie search rules are used for locating included files. The current place is defined by the original source file and is not stacked. See The current place for more information. If you do not use this option, Berkeley-style searching is used.

--sys_include

Removes the current place from the include search path. Quoted include files are treated in a similar way to angle-bracketed include files, except that quoted include files are always searched for first in the directories specified by -I, and angle-bracketed include files are searched for first in the -J directories (see Table 2.4).

-Jdirectory

Adds the specified directory, or comma-separated list of directories, to the list of system includes. RVCT30INC is set as the default system include unless you use -J to override it. Angle-bracketed include files are searched for first in the list of system includes, followed by any include list you have specified with -I.

Note

If you specify RVCT30INC on the command line, you must enclose this in double quotes because the default path defined by this environment variable contains spaces.

See Included files for complete details on how the compiler handles include files.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0205G
Non-Confidential