[Lazarus] Projects in a directory hierarchy - what is allowed?

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Feb 3 11:29:15 CET 2020


On Sun, 02 Feb 2020 23:50:59 +0100
Bo Berglund via lazarus <lazarus at lists.lazarus-ide.org> wrote:

>[...]
> It was started on Raspbian, but I had problems with the Lazarus IDE
> (it crashes regularly several times a day and then I lose all edits
> since the last save).

Can you create stacktraces of the crashes?

>[...]
> If I now open the project in Lazarus and command Compile, build or
> Quick compile an error is triggered telling me that a file not used by
> my project cannot find its Linux-only units in the uses clause....
> Here the show stops!

Does a clean build work? For example "Run / Clean up and build ..."?

 
> It complains that it cannot find some unix-only units inside the
> sourcefile PiGpio.pas, which is used by another project residing one
> level up in the tree from the working dir of the current project.

Compile with flag -vt to find out why the compiler uses PiGpio.pas.

Or in Lazarus use View  / Unit Dependencies.
Click left on PiGpio.pas and look on the right for "used by ...".

 
>[...]
> Questions:
> 1) Is it not allowed to use source files *above* the current project
> dir?

Of course it is allowed.

 
> 2) If I add a path .. via project properties does this really mean
> that Lazarus will try to compile ALL source files found there even if
> only a couple are part of the current project?

No. FPC will compile only sources used by your project - direct and
indirect. Maybe you have some indirect dependency or some old ppu file.

 
> 3) What can I do to remedy this problem?

1. compile clean and check if this makes a difference
2. Compile with -vt flag.
3. Check View / Unit dependencies
4. Since you are using Windows and Unix and have mixed case unit names,
you must make sure, that all uses sections use the correct case.
5. give us more information, e.g. directory listings

Mattias




More information about the lazarus mailing list