[Lazarus] Compiling LCL units via commandline

luciano de souza luchyanus at gmail.com
Wed Jul 25 13:01:50 CEST 2012


Hello listers,

I am blind and I use Freepascal by means of a screen reader. Recently,
I and other four blind programers wanted to compile a project which
implies the usage of LCL units. The very reduced accessiblity of
Lazarus environment make us to decide to compile everything via FPC.

fpc project.pp

Under FPC, it doesn't compile. In spite of the fact FPC is inside the
Lazarus, it does not configured to search for LCL units. So we add in
fpc.cfg:

-FuC:\lazarus\components
-FuC:\lazarus\components\*
-FUC:\lazarus\lcl
-FUC:\lazarus\lcl\*
-FiC:\lazarus\lcl\include
-FuC:\lazarus\units
-FuC:\lazarus\units\*

The paths were found, but there is a circular reference between
messages and lmessages.

Having reported it in a forum, I member told me about lazbuild. I
should manually create a XML file with the project settings and try to
compile again. The same error about circular reference is raised.

Yes, Lazbuild can be used. But I confess this option strongliy upset
me. Lazbuild calls several routines and after all calls FPC. If you
imagine the screen reader reads all the output, not having a way to
jump the unneeded information, you will evaluate how slow can be the
compilation using Lazbuild. The output of FPC is not so verbose, so
it's prefferable to use FPC without Lazbuild.

I tried to compile the following example program:

program e026;
{$mode objfpc}{$H+}

uses
interfaces, dialogs;

BEGIN
END.

Under certain point of view, our project has an educational focus.
Blind programers with few or any experience is our public. If the
first contact with Pascal is complex, people can give up. And the
first contact, according this project, implies the usage of LCL. There
is a Pascal voice system called Dosvox writen in Pascal. It offers a
good set of units for developers. Let me give you an example: the crt
unit was converted into dvcrt unit and syntwriteln in place of only
show a message, can also speak it.

My conclusion is: I need LCL, but how to compile any code using only
Freepascal? How can I configure my fpc.cfg to search for any unit in
Lazarus folders and compile any type of project? Console? Graphical?

And to avoid this work, I suggest the standard distribution of Lazarus
includes an FPC configured to compile everything.
The ideal would be to do all in the Lazarus interface, but it's
impossible. Among other reasons, the label of widgets produced by LCL
can't be read by screen readers. But it's subject for another message!

Regards,

-- 
Luciano de Souza




More information about the Lazarus mailing list