[Lazarus] Projects in a directory hierarchy - what is allowed?
bo.berglund at gmail.com
Sun Feb 2 23:50:59 CET 2020
I have encountered a strange problem that was discovered when I moved
sources between Windows 10 and Raspbian Buster.
It appears that my directory structure does not behave like when I
I am using Lazarus 2.0.6 and FPC 3.0.2 in both Windows 10 and Raspbian
Buster (on an RPi4B with 4GB RAM).
I am working on a webapp (command line program supplying webpages on
demand from Apache) as part of a larger system of programs to control
hardware through the RPi4.
I have used a directory structure where the main control app resides
in a top directory with subdirectories for various utilities (like the
webapp for configuration purposes).
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). So I moved over to Windows and got the sources
via Subversion. On Windows Lazarus never crashes.
Then I could develop here and use the IDE to check that it builds. I
could not use the exe file with Apache because I don't have apache on
Windows, but I could work around it and check the output of the webapp
anyway using environment variables when I run the executable.
So far so good, but to do the tests properly through Apache I moved
back to RPi4 (via SVN) and it worked just fine there too. I could make
adjustments etc and test via apache that the webapp worked.
Then I did a new cycle back to Windows and now something has happened
that is a showstopper.
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!
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.
I have had to add a path to the parent dir (../) in the project
options because I need a few common units which define some used
classes and these units reside one level up.
But these are only 3 units and definitely NOT the units that use
The unit where PiGpio is in the uses clause is a completely separate
source file for another project.
1) Is it not allowed to use source files *above* the current project
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?
3) What can I do to remedy this problem?
Developer in Sweden
More information about the lazarus