[Lazarus] Converting a console app

Michael Van Canneyt michael at freepascal.org
Wed Jun 30 13:51:50 CEST 2010



On Wed, 30 Jun 2010, Juha Manninen wrote:

>> It's lack of Interfaces unit.
>
> Right! I forgot it because normally it is added by the IDE save project
> function and not by converter.
> The save function adds it only if it finds Forms unit in uses section (IIRC).
>
>
>> Console applications are not always Windows dependant.
>> So I guess adding LCL dependency + Interfaces, LCLIntf units should
>> NOT be strict.
>>
>> i.e.
>>
>> begin
>>   writeln('hello world');
>> end.
>>
>> No need for LCL units here :)
>
> Yes. I just need to decide clear rules for the converter. I don't want to make
> any deep analysis about if a called function is found in LCL units. (Unless
> there is an easy way to do it).
> I think it is OK to always all LCL dependency and Interfaces unit.

I think it is definitely NOT OK to do so.

There is no reason whatsoever to drag in the nogui widgetset and whatnot in
a  console application. That is just plain wrong. Someone using e.g. the
forms unit in a console application is coding wrong, and he should be
pointed out this fact by letting the compile step fail.

Michael.




More information about the Lazarus mailing list