[lazarus] How do I compile a form

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jan 21 12:43:12 EST 2002


On Mon, 21 Jan 2002 12:26:19 -0500
rob young <roblinux at rogers.com> wrote:

> When I compile a very basic program is works Lazarus works fine. When I 
> add a form I get the following error at the end of this email.
> 
> (I am compiling in Linux) 
> /home/rob/lazarus/lazarus/lcl/interfaces/gtk/interfaces.pp
> 
> was added to my project in this case, but the compiler does not seem to 
> be able to find it.
> I also added 
> /home/rob/lazarus/lazarus/lcl/interfaces/gtk/
> to my Libraries but the compiler still does not seem to find the 
> interfaces.pp

DON NOT add any source path of the LCL to your search paths. (e.g. $(LazarusDir)/lcl or $(LazarusDir)/lcl/interfaces/gtk).
The compiler will try to recompile the LCL and will probably fail.


Just add the two ppu paths to your search path:

1. /home/rob/lazarus/lazarus/lcl/units
2. /home/rob/lazarus/lazarus/lcl/units/gtk


There are 3 ways of adding search paths:

A.
In the IDE you can simply set 
Run -> Compiler Options -> Search Paths -> Other unit files to

$(LazarusDir)/lcl/units;$(LazarusDir)/lcl/units/gtk

This will add the path for the current project. The IDE will set this path automatically, if you create a new project of type 'Application'.


B.
At the command line you can use:

ppc386 -Fu/home/rob/lazarus/lazarus/lcl/units -Fu/home/rob/lazarus/lazarus/lcl/units/gtk project1.pas


C.
Or you can add the path for all your projects, by adding the path to the compiler search path:
In the /etc/fpc.cfg add these two lines:

-Fu/home/rob/lazarus/lazarus/lcl/units 
-Fu/home/rob/lazarus/lazarus/lcl/units/gtk


Mattias






More information about the Lazarus mailing list