[Lazarus] Problem Finding Units

Martin lazarus at mfriebe.de
Fri Jul 8 13:41:35 CEST 2011


On 08/07/2011 12:16, David Riley wrote:
> 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.
>

There is a difference between Lazarus and FPC finding it...

1) Do not copy the files from the SynEdit package to your path. never ever.
2) Do not add any -Fu -Fi or other custom path to your project, that 
points to synedit...

- In "project inspector", SynEdit is present as package under dependencies?
- Make sure you have only one version of FPC. As soon as 2 versions 
(even minor versions, even svn revisions) of FPC get's mixed, things go 
unexpected....
- Make sure, nowhere in your project, or in any path that you may have 
added yourself to the project, is a synedit.ppu (or any ppu for 
synedit*, except your highlighter)
- Compile with -va (and look add all+hidden msgs) to see where fpc looks 
for the file, and why they may be rejected. (a lot of output in msgs)

I assume you create the new highlighter in code? As it is not 
registered, you can not ue it on the form designer. (nor put it by hand 
into the lfm)









More information about the Lazarus mailing list