[Lazarus] Where in Lazarus 1.5 do I set the project search path?

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Oct 22 01:36:23 CEST 2015


On Wed, 21 Oct 2015 23:46:07 +0200
Bo Berglund <bo.berglund at gmail.com> wrote:

> Stupid question but when I google I find "solutions" that direct me to
> Project/Project Options/Compiler/Paths and Inherited of which only
> Paths exist...

The "Inherited Path" are nowadays found in "Project / Project Options /
Show Options / Inherited Parameters". They list what came from the
packages.


> Then I am directed to source editor / popup menu / file settings /
> unit info / unit paths

These are the combined paths of project and all packages for a single
directory. These are the end result after combining, resolving
macros and removing duplicates.


> But there is no such thing in my Lazarus...
> On the Paths page there is no mention of "source editor".
> 
> Example webpage with this non-working info:
> http://wiki.freepascal.org/Unit_not_found_-_How_to_find_units
> 
> So where exactly do I go in Project settings to view/set the project
> search path?
> I want to partition my sources into functional parts each in its own
> subdirectory so the path to that must be set somewhere.

Since you are coming from Delphi, keep in mind that Lazarus was
designed for cross platform and sharing code.
All search paths are relative.
If your project has a sub directory "stuff" containing .pas files, then
add "stuff" to "Project / Project Options / Compiler Options / Paths /
Other unit files".

If you want to use a bunch of units in several projects, put them into
a directory of their own and create a package. Instead of adding the
search path to a project add the package. The IDE automatically creates
the search paths for you.
When you want to use the units on another machine, simply copy the
directory and open the .lpk file once. The IDE now knows where the
package is and any project using the package don't need to worry about
the search path.

Mattias




More information about the Lazarus mailing list