3.1.3 Include les

If you include les in your source with the f$I filenameg directive, the compiler will look for it in the following places:

  1. It will look in the path specied in the include le name.
  2. It will look in the directory where the current source le is.
  3. it will look in all directories specied in the include le search path.

You can add les to the include le search path with the -I (see page 5.1.3) or -Fi (see page 5.1.3) options.

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

 
{$i ../bar.inc}  

Then the following command :

fpc -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 incles directory of the current directory.