[Lazarus] Problem Finding Units

David Riley dmfnr1 at gmail.com
Fri Jul 8 13:16:43 CEST 2011


I'm trying to figure out whether this bizarre behavior is a mistake on
my side or a bug with Lazarus.  I've been working on a project featuring
the SynEdit component, using the FPC highlighter as a dummy highlighter
while I was developing a new highlighter for a specific language my
project is centered around.  Everything was working fine until I was
ready to start testing my own highlighter.  At this point the
highlighter is still unfinished and I am just including it as a unit in
my project and using it as any other class rather than dealing with the
complexities of registering it in Lazarus as a Design Time component.
After I removed the references to TSynHighlighterPas and replacing them
with my own, I started to run in to this odd problem.  All of a sudden
when attempting to build, FPC reported that it was unable to find the
SynEdit unit.  SynEdit is included as a dependency in the project
inspector, and here's the bizarre part.  After reporting that it cannot
find the unit, Lazarus actually opens the SynEdit.pp file in the editor.
What the hell does it mean it can't find it and then opens it in the
editor.  Hovering the mouse over the unit in the Uses block shows the
correct location for the unit (/usr/lib/... on Linux, c:\lazarus\... on
Windows).  So I copied the files from my source directory in to my
project directory, and then it was suddenly able to find the Unit, and
reported the next unit TSynEditTypes or whatever missing.  Even more
bizarre, if I delete all references to SynEdit in my project, and
attempt to create one from the component palette, it is now referencing
my project directory as the location of the unit.

None of the search path for the units seem to have changed after adding
the new highlighter, and as I stated before SynEdit is included as a
dependency in the project inspector.  I just don't understand why it all
of a sudden can't find the SynEdit units all of a sudden after adding a
single new unit to the project.  I can understand why the problem goes
away after I add them to my projects directory obviously, but why is it
only having problems with the SynEdit units and not the rest of the LCL.
I would appreciate it very much if someone could let me know what I'm
doing wrong here, or if this is a bug I would gladly file a bug report
for it.

This is happening on both the version 0.9.28.2 included in the Ubuntu
10.04 repos, and the 0.9.30 release available for win64.

Thank you,
David Riley





More information about the Lazarus mailing list