| United States-English |
|
|
|
![]() |
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line OptionsHeader File Options |
|
Following are the command-line options you can use for header files: cc -H file The -H option causes HP aC++/HP C to print the order and hierarchy of included files. The -H option dumps the include heirarcy to stderr so that the preprocessed compiler output indicates the include file nesting. aCC progname -c +hdr_create headername This option extracts the header from a program file and saves it as a precompiled header file. Example: aCC ApplicTemplate.C -c +hdr_create ApplicHeader aCC progname +hdr_use headerfile -c This option adds a precompiled header file to a program when the program is compiled. Example: aCC Applic.C +hdr_use ApplicHeader -c -I directory directory is the HP-UX directory where the compiler looks for header files. During the compile phase, this option adds directory to the directories to be searched for #include files during preprocessing. During the link phase, this option adds directory to the directories to be searched for #include files by the link-time template processor. For #include files that are enclosed in double quotes (" ") within a source file and do not begin with a /, the preprocessor searches in the following order:
For #include files that are enclosed in angle brackets (< >), the preprocessor searches in the following order:
Example: The following example directs the compiler to search in the directory include for #include files. aCC -I include file.C [-Idirs] -I- [-Idirs] [-Idirs] indicates an optional list of -Idirectory specifications in which a directory name cannot begin with a hyphen (-) character. The -I- option allows you to override the default -Idirectory search-path. This feature is called view-pathing. Specifying -I- serves two purposes:
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 -Idirectory search-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. aCC -Idir1 -Idir2 -c a.C With view-pathing on, the following example searches for quoted include files in dir1 first and dir2 next, followed by the standard include directories, ignoring the directory of a.C. Angle-bracketed includes are searched for in dir2 first, followed by the standard include directories. aCC -Idir1 -I- -Idir2 -c a.C
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||