Search Paths for Included Source Files (OS/2, Windows)

Included sources are C and C++ source files that are included in a build because they are listed in #include preprocessor directives in other source files.

If a file is named as a primary C++ source in your configuration file, as well as being included with a preprocessor directive, VisualAge C++ treats it as a primary source and not as an included source.

The search rules depend on whether the included files are system or user included files.

Searches For System Included Files
For all system included files , VisualAge C++ searches in the following order:

  1. The path or paths specified with incl(searchPath, path) are searched first.
  2. The paths specified by the INCLUDE environment variable are searched last.

The INCLUDE environment variable is set when you run open the VisualAge C++ command line window, or when you select and open an icon that is placed in the VisualAge C++ program group during installation.

For C source files, you also can tell the compiler to ignore the paths specified with incl(searchPath, path) by building with file(ignoreusrincpaths) and to ignore the INCLUDE environment variable by building with file(ignoreEnvIncPaths). Both file(ignorenvincpaths) and file(ignoreusrincpaths) apply to system include files and user include files.

Searches for User Included Files
For user included files, the search path includes a directory relative to the source files. This directory is chosen by the following criteria:

For C, the directory is the one in which the file containing the top-level #include directive resides, regardless of whether that file directly or indirectly includes other files.
When you build from C++ sources files with incl(userStrategy, primary), which is the default setting og this option, the directory contains the primary file that has the #include directive, regardless of whether it directly or indirectly includes other files.
When you build from C++ sources with incl(userStrategy, including), the directory contains the file that has #include directive that directly includes other files. In this case, the including file may itself be an included file, rather than a primary file, and may be in a different directory from the primary file that included it.

VisualAge C++ follows the order shown below when you build form C++ source files with incl(searchPathFirst, no). The default setting of this option is no.

  1. The directory relative to source files is searched first.
  2. The path or paths specified with incl(searchPath, path) is searched next.
  3. The paths specified by the INCLUDE environment variable are searched last.

VisualAge C++ follows the order below when you build with incl(searchPathFirst, yes):

  1. The path or paths specified with incl(searchPath, path) is searched first.
  2. The directory relative to source files is searched next.
  3. The paths specified by the INCLUDE environment variable are searched last.


Incremental C++ Build
C Compilation
C++ Source Files and Source Regions
Search Paths for Primary Source Files
Linker Searches


Add or Change Source Files
Set Build Options
Build


Miscellaneous Build Options