INCLUDE Environment Variable

The INCLUDE environment variable value:
  • Contains a path of directories delimited by colons (:)
  • Does not override the order
  • Has higher priority in the search order than the default include path
  • Has a lower priority in the search order than INCDIR and the root source's directory (for a user-defined include search)

If the include search contains a defined INCLUDE environment variable for both C and C++ compilers, the resulting include search order including is as shown in the following table:

Table 1. Include Search Order
#include type Directory Search Order
#include <file_name>
  1. If you specify a directory in the INCDIR parameter, the compiler searches for file_name in that directory first.
  2. If more than one directory is specified, the compiler searches the directories in the order that they appear on the command line.
  3. If the INCLUDE environment variable is defined, the compiler searches the directories in the order they appear in the INCLUDE path.
  4. Searches the directory /QIBM/include.
#include "file_name"
  1. Searches the directory where your current source file resides. The current source file is the one that contains the directive #include "file_name".
  2. If you specify a directory in the INCDIR parameter, the compiler searches for file_name in that directory.
  3. If more than one directory is specified, the compiler searches the directories in the order that they appear on the command line.
  4. If the INCLUDE environment variable is defined, the compiler searches the directories in the order they appear in the INCLUDE environment variable.
  5. Searches the directory /QIBM/include.
Note: This feature is only available for source stream file compiles.