[Lazarus] Fwd: newbie

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Jan 12 00:35:03 CET 2014


On Sat, 11 Jan 2014 23:12:19 +0100
duilio foschi <octopushole at gmail.com> wrote:

> the compiler says "Can't find unit ComponentTreeView used by ObjectInspector".
> 
> This message in plain English language seems clear to me, also because
> I am accustomed to it (I have been working with Delphi since v. 1).

Yes, I agree with you.

 
> Nothing of that.
> 
> The compiler wants to mean "I found unit ComponentTreeView and want to
> compile it again but I should not".

Well, that's not exactly what I wrote, but I think you got the
right direction.

 
> As in the old joke, this clearly shows that Lazarus is female :)
> 
> I hope you are wrong, because I wont work with a tool that gives so
> misleading messages.

Well, "unit not found" is maybe the most misleading message of
lazarus/fpc, because there are more than 20 different errors that can
lead to this message. The error could be made by you or by one of the
maintainers of one of the packages you installed or by the fpc
release or there is even a compiler bug that can lead to this
error.
fpc is a mighty compiler that gives the programmer a vast flexibility
where to put units and how to combine them. But without limits it is
hard to say when something went wrong.

 
> Anyway your suggestions didnt work ... or I didnt apply them in the correct way.
> 
> This is what I did
> 
> 1. added switch -vut to CONFIGURE BUILD LAZARUS
> http://it.tinypic.com/r/f24u83/5

ok

 
> 2. opened the package I am interested in
> http://it.tinypic.com/r/rc8tok/5
> 
> 3. compiled the package
> http://it.tinypic.com/r/s2fd3s/5
> 
> 4. tried to install it...
> http://it.tinypic.com/r/2a7bpg9/5
> http://it.tinypic.com/r/qqx17l/5

ok

 
> 5. after a few minutes, I see the same error message as before
> http://it.tinypic.com/r/2il24ur/5

Yes.
Now right click on the messages window and click on "Save all messages
to a file", e.g. "unitnotfound.txt". Then open the file and look at
the messages. Search for componenttreeview case insensitive.

 
> I hope that Lazarus _really_ cant find unit ComponentTreeView and that
> there is a way to tell Lazarus where to search for it... :)

Well, usually it is not something missing, but something too
much. I will try to explain:
The last message "unit not found" is a subsequent error. The real
error happened earlier.
Keep in mind that there are unit sources (.pas or .pp files) and
compiled units (.ppu files). When the compiler writes "can't find unit
ComponentTreeView" and a line above "loading componenttreeview.ppu", it
means that the *compiled* unit is outdated (or: does not fit). It
would be nice if the compiler would write why the unit is outdated,
but it does that only when compiling with -vut.
Usually a unit is outdated because some source has changed. Then the
compiler should search the unit source and recompile the unit. The
compiler searches and fails. And that's why you see the last error
message.

In this case the source is not outdated. The unit was already compiled by an
earlier invocation of the compiler.

Questions:
Can you compile the IDE without the package GR32_dsgn?
Where did you get GR32_dsgn?
How did you install Lazarus? Via the installer from the Lazarus
page on source forge?
What fpc version do you use?

Mattias




More information about the Lazarus mailing list