SPRUIG8J January 2018 – March 2024
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 |
|
Windows |
|
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 C7X_C_DIR environment variable.
For example, if you set up C7X_C_DIR with the following command:
C7X_C_DIR "/usr/include;/usr/ucb"; export C7X_C_DIR
or invoke the compiler with the following command:
cl7x --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