[fpc-devel] Unit search order

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jul 8 15:07:09 CEST 2010

On 08 Jul 2010, at 15:46, Hans-Peter Diettrich wrote:

> But only when the search for used units exactly follows the search  
> path, and does not look into the directory of the using unit first.  
> Is this guaranteed?

The opposite is guaranteed. This is the search order for units:

   1. look for ppu in cwd
   2. look for ppu in outputpath if set, this is tp7 compatible (PFV)
   3. look for ppu in maindir  (= dir containing source file specified  
on the command line)
   4. look for source in cwd
   5. look for source in maindir
   6. local unit pathlist (first ppu, then source)
   7. global unit pathlist (first ppu, then source)


PS: the next time, please start a new thread when switching topics.

More information about the fpc-devel mailing list