You can add pathes, so long as each path can only be reached once.
You need to understand this. Compilation works like this
- Each package is compiled into a ppu
- if a package has "uses", each used package needs to exist as ppu.
If it does not exist, the compiler will first compile it into a ppu, then use that ppu
(there is some magic for circle refs....)
The rule should be: Each file belongs either to your project OR to a package. But only to ONE. Never to more than one.
A package or project can have as many source (pp/pas) locations as you like. But the must belong only to that package or project.
All those are compiled into ppu.
Each package or project should have just one folder for ppu (all else gets really complicated).
If 2 packages see the same source, it is as if that source exists twice => boom.
You have to understand is, that compilation is done package by package.
- So LCL compiles forms.pas into forms.ppu
- Then all further packages/projects, will see forms.ppu only. They will not see forms.pas.
If they did (if you tweaked the path), they would create a 2nd forms.ppu in their ppu folder..... => boom
Extra ppu path can be handy if you have bought 3rd party components for which you have no source, but ppu only => then the compiler only sees the ppu, and no sources.
In theory a path can be included by 2 projects. Since at any time only one is compiled, and the other does not depend on it.
The 2 projects will never see each others ppu folder. So the 2 ppu will never conflict.
But to avoid having to deal with all that yourself, put such files into a package. And use the package. Then the IDE can work its magic.
If you go further on this, always look at the full fpc output, not just the messages window. (copy all....)
Also compile with -va which means the compiler will tell you every file it looks at, and where it looks for them (hell of a lot of info...)