next up previous contents
Next: Object files Up: Compiler usage Previous: File searching

Include files

If you include files in your source with the {$I filename} directive, the compiler will look for it in the following places:

  1. It will look in the path specified in the incude file name.
  2. It will look in the directory where the current source file is.
  3. it will look in all directories specified in the include file search path.
You can add files to the include file search path with the -I (See 5.1) option.

As an example, consider the following include statement in a file units/foo.pp:

{$i ../bar.inc}
Then the following command :
ppc386 -Iincfiles units/foo.pp
will cause the compiler to look in the following directories for bar.inc:
  1. the parent directory of the current directory
  2. the units subdirectory of the current directory
  3. the incfiles directory of the current directory.


Michael Van Canneyt
Thu Sep 10 13:56:17 CEST 1998