Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-07

Unit search order

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
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)

Jonas

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

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote 8 lines
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.

Sorry, that's wrong. I had deleted that statement from the wrong reply (the one to the original message in the wrong thread, instead of the new thread). The compiler never changes the cwd (current working directory), so the location of a unit has no influence on where the units it uses are searched.

Jonas

Reply by email