SLAU132Y September 2004 – June 2021
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 MSP430_C_DIR environment variable.
For example, if you set up MSP430_C_DIR with the following command:
MSP430_C_DIR "/usr/include;/usr/ucb"; export MSP430_C_DIR
or invoke the compiler with the following command:
cl430 --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