[lazarus] Newbie Q : Can't find classes.pas...

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jun 28 16:16:00 EDT 2002

On Fri, 28 Jun 2002 19:36:38 +0200
Marc Weustink <marc at dommelstein.net> wrote:

> At 01:35 29/06/2002 +1000, David Creelman wrote:
> >Hi Mattias,
> >
> >Here it is.
> >
> >The only change I made was in Makefile.fpc to try to get it to find gtk
> >
> >         unitdir=lcl/units /usr/lib/fpc/1.0.6/units/linux/gtk lcl/u....
> >
> >This didn't work,
> Luckely it didn't :-) (you need to run fpcmake after changing Mekefile.fpc)
> gtk shouldn't be needed here
> >copying the ppu did. I'm using the 1.0.6 fpc rpm and
> >downloaded and installed the source rpm as well.

Just for clarity: The sources are not needed to compile lazarus and pointing searchpaths into them is a bad idea.
The sources are needed by the (running) lazarus IDE as SRCpath. This is needed to get additional information.

> Hmm..... from your output:
> >make[2]: Entering directory `/home/davidc/develop/lazarus/components/synedit'
> >/bin/rm -f ../units/allunits.ppu
> >/usr/bin/ppc386 -gl -Fu../../lcl/units/gtk -Fu../../lcl/units -Fu. 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/rtl 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/paszlib 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/inet 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/fcl 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/regexpr 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/mysql 
> >-Fu/usr/lib/fpc/1.0.6/units/linux/ibase -FU../units 
> >-Fl/usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96 -Fl/usr/X11R6/lib 
> >-Fl/usr/lib/qt2/lib -Fl/usr/local/lib/wine -Fl/usr/local/lib -di386 allunits.pp
> >Free Pascal Compiler version 1.0.6 [2002/05/23] for i386
> >Copyright (c) 1993-2002 by Florian Klaempfl
> >Target OS: Linux for i386
> >Compiling allunits.pp
> >Compiling syntextdrawer.pp
> >gtkint.pp(74,11) Fatal: Can't find unit GTK
> Why is gtkint complaining here...  gtkint is part of the interface for GTK. 
> This directory is part of components and should be independent of the 
> platform. Thats why there is nu reference to a gtk dir.
> It seems to me that somehow there is a platform dependency in SynEdit which 
> shouldn't be there.

The compiler messages are irritating. 
Of course there is no platform dependency in the synedit sources. 
But I know this output. I got it on a nfs filesystem. When you compile with -va you find out more:
First the lcl and then the gtk-interface is compiled. Everything seems to be allright. But when compiling synedit the compiler loads the ppu file and wants to recompile the interfaces.pp of the gtk-interface and hence it searches for the depending gtk sources. But the synedit Makefile does not contain any clue to the gtk .ppus and therefore the compiler fails with the strange error message.
Even more strange was the fact, that this error only happened if you compile lazarus in one step via a script (or Makefile). Compiling it manually always worked.
I copied the files to a local disk and everything compiles fine. But the error vanished some time ago. I can't say, if it was the update to a newer 1.0.7 or an update to the network. 
I know there is another person who had definitely a correct setup and got the same error but on a local disk. It also disappeared after some (un)successful searching.
So, there is a compiler bug, but it appears only in very rare cases. Spooky fpc.

Final note: The error appears much more often, but in 90% it is just a misconfiguration. These are handled in the FAQ.


More information about the Lazarus mailing list