|
VMS Help CXX, Qualifiers, /INCLUDE_DIRECTORY *Conan The Librarian |
/INCLUDE_DIRECTORY
/INCLUDE_DIRECTORY=(place[,...])
/NOINCLUDE_DIRECTORY (D)
Provides an additional level of search for user-defined include
files. Each pathname argument can be either a logical name or
a legal UNIX style directory in a quoted string. The default is
/NOINCLUDE_DIRECTORY.
The /INCLUDE_DIRECTORY qualifier provides functionality similar
to the -I option of the cxx command on Tru64 UNIX systems.
This qualifier allows you to specify additional locations to
search for files to include. Putting an empty string in the
specification prevents the compiler from searching any of the
locations it normally searches but directs it to search only
in locations you identify explicitly on the command line with
the /INCLUDE_DIRECTORY And /LIBRARY qualifiers (or by way of
the specification of the primary source file, depending on the
/NESTED_INCLUDE_DIRECTORY qualifier).
The basic order for searching depends on the form of the header
name (after macro expansion), with additional aspects controlled
by other command line qualifiers as well as the presence or
absence of logical name definitions. The valid possibilities
for names are as follows:
o Enclosed in quotes. For example: "stdio.h"
o Enclosed in angle brackets. For example: <stdio.h>
Unless otherwise defined, searching a location means that the
compiler uses the string specifying the location as the default
file specification in a call to an RMS system service (that is,
a $SEARCH/$PARSE) with a primary file specification consisting
of the name in the #include (without enclosing delimiters). The
search terminates successfully as soon as a file can be opened
for reading.
Specifying a null string in the /INCLUDE qualifier causes the
compiler to do a non-standard search. This search path is as
follows:
1. The current directory (quoted form only)
2. Any directories specified in the /INCLUDE qualifier
3. The directory of the primary input file
4. Text libraries specified on the command line using /LIBRARY
For standard searches, the search order is as follows:
1. Search the current directory (directory of the source
being processed). If angle-bracket form, search only if no
directories are specified with /INCLUDE_DIRECTORY.
2. Search the locations specified in the /INCLUDE_DIRECTORY
qualifier (if any).
3. If CXX$SYSTEM_INCLUDE is defined as a logical name, search
CXX$SYSTEM_INCLUDE:.HXX or just CXX$SYSTEM_INCLUDE:.,
depending on the qualifier /ASSUME=NOHEADER_TYPE_DEFAULT.
If nothing is found, go to step 6.
4. If CXX$LIBRARY_INCLUDE is defined as a logical name,
CXX$LIBRARY_INCLUDE:.HXX or CXX$LIBRARY_INCLUDE:., depending
on the qualifier /ASSUME=NOHEADER_TYPE_DEFAULT. If nothing is
found, go to step 6.
5. If /ASSUME=HEADER_TYPE_DEFAULT is not specified, search the
default list of locations for plain-text copies of compiler
header files as follows:
SYS$COMMON:[CXX$LIB.INCLUDE.CXXL$ANSI_DEF]
SYS$COMMON:[CXX$LIB.INCLUDE.DECC$RTLDEF_HXX].HXX
SYS$COMMON:[DECC$LIB.INCLUDE.DECC$RTLDEF].H
SYS$COMMON:[DECC$LIB.INCLUDE.SYS$STARLET_C].H
If /ASSUME=HEADER_TYPE_DEFAULT is specified, search the
default list of locations for plain-text copies of compiler
header files as follows:
SYS$COMMON:[CXX$LIB.INCLUDE.DECC$RTLDEF_HXX].HXX
SYS$COMMON:[DECC$LIB.INCLUDE.DECC$RTLDEF].H
SYS$COMMON:[DECC$LIB.INCLUDE.SYS$STARLET_C].H
SYS$COMMON:[CXX$LIB.INCLUDE.CXXL$ANSI_DEF]
6. Search the directory of the primary input file.
7. If quoted form, and CXX$USER_INCLUDE is defined as a logical
name, search CXX$USER_INCLUDE:.HXX or CXX$USER_INCLUDE:.,
depending on the /ASSUME=NOHEADER_TYPE_DEFAULT qualifier.
8. Search the text libraries. Extract the simple file name and
file type from the #include specification, and use them to
determine a module name for each text library. There are three
forms of module names used by the compiler:
1. type stripped:
The file type will be removed from the include file
specification to form a library module name. Examples:
#include Module name "FOO"
"foo.h"
#include Module name "FOO"
"foo"
#include Module name "FOO"
"foo"
2. type required:
The file type must be a part of the file name. Examples:
#include Module name "FOO.H"
"foo.h"
#include Module name "FOO."
"foo"
#include Module name "FOO."
"foo"
3. type optional:
First an attempt is made to find a module with the type
included in the module name. If this is unsuccessful, an
attempt is made with the type stripped from the module
name. If this is unsuccessful, the search moves on to the
next library.
If /ASSUME=HEADER_TYPE_DEFAULT is specified, the following
text libraries are searched in this order:
Libraries specified on the command line with the /LIBRARY
qualifier (all files, type stripped)
CXX$TEXT_LIBRARY (all files, type stripped)
DECC$RTLDEF (H files and unspecified files, type stripped)
SYS$STARLET_C (all files, type stripped)
CXXL$ANSI_DEF (unspecified files, type stripped)
Otherwise, these text libraries are searched in this order:
Libraries specified on the command line with the /LIBRARY
qualifier (all files, type optional)
CXX$TEXT_LIBRARY (all files, type optional)
CXXL$ANSI_DEF (all files, type required)
DECC$RTLDEF (H files and unspecified files, type stripped)
SYS$STARLET_C (all files, type stripped)
Two text library search examples (stop when something is
found):
Example 1
#include "foo"
1. For each library specified via the /LIBRARY qualifier:
- Look for "FOO."
- Look for "FOO"
2. Look for "FOO." in CXX$TEXT_LIBRARY
3. Look for "FOO" in CXX$TEXT_LIBRARY
4. Look for "FOO." in CXXL$ANSI_DEF (Do not look for "FOO"
because the type is required as part of the module name)
5. Look for "FOO" in DECC$RTLDEF (not "FOO." because the type
must not be part of the module name)
6. Look for "FOO" in SYS$STARLET_C (not "FOO." because the
type must not be part of the module name)
Example 2
#include "foo.h"
1. For each library specified via the /LIBRARY qualifier:
- Look for "FOO.H"
- Look for "FOO"
2. Look for "FOO.H" in CXX$TEXT_LIBRARY
3. Look for "FOO" in CXX$TEXT_LIBRARY
4. Look for "FOO.H" in CXXL$ANSI_DEF (Do not look for "FOO"
because the type is required as part of the module name)
5. Look for "FOO" in DECC$RTLDEF (not "FOO.H" because the type
must not be part of the module name)
6. Look for "FOO" in SYS$STARLET_C (not "FOO.H" because the
type must not be part of the module name)
7. If neither CXX$LIBRARY_INCLUDE nor CXX$SYSTEM_INCLUDE is
defined as a logical name, then search SYS$LIBRARY:.HXX.
|
|