Adding a Directory to the #include File Search Path (--include_path Option)

The --include_path option names an alternate directory that contains #include files. The --include_path option's short form is -I. The format of the --include_path option is:

--include_path=directory1 [--include_path=directory2 ...]

There is no limit to the number of --include_path options per invocation of the compiler; each --include_path option names one directory. In C source, you can use the #include directive without specifying any directory information for the file; instead, you can specify the directory information with the --include_path option.

For example, assume that a file called source.c is in the current directory. The file source.c contains the following directive statement:

#include "alt.h"

Assume that the complete pathname for alt.h is:

UNIX /tools/files/alt.h
Windows c:\tools\files\alt.h

The table below shows how to invoke the compiler. Select the command for your operating system:

Operating System Enter
UNIX armcl --include_path=/tools/files source.c
Windows armcl --include_path=c:\tools\files source.c

NOTE

Specifying Path Information in Angle Brackets

If you specify the path information in angle brackets, the compiler applies that information relative to the path information specified with --include_path options and the TI_ARM_C_DIR environment variable.

For example, if you set up TI_ARM_C_DIR with the following command:

TI_ARM_C_DIR "/usr/include;/usr/ucb"; export TI_ARM_C_DIR

or invoke the compiler with the following command:

armcl --include_path=/usr/include file.c

and file.c contains this line:

#include <sys/proc.h>

the result is that the included file is in the following path:

/usr/include/sys/proc.h