[Lazarus] Lazarus implementation of TListView etc?

Sven Barth pascaldragon at googlemail.com
Fri Oct 23 17:13:55 CEST 2015


Am 23.10.2015 14:29 schrieb "Bo Berglund" <bo.berglund at gmail.com>:
> So I am a bit surprised that just using this unit would make the FPC
> command program not work...

It's not exactly FPC's fault, but more that one must not take one's
environment for granted. E.g. on Windows you basically always have a GUI
which is provided by the core OS (yes, there are things like headless
servers or the new Windows 10 for IoT). On Linux systems on the other hand
the GUI is entirely optional and provided by the distribution (I simplified
here). In addition there can be multiple GUI toolkits (GTK and Qt to name
two). If you now have for some reason a dependency on a Qt library but try
to run it on a system without Qt your applications won't work.
This part is solved by not using the Interfaces unit which is required for
LCL GUI applications and which pulls in the widgetset (WinAPI, GTK, Qt,
etc.) dependency (you are already doing this).
However there /might/ be unit initialization sections in the LCL units that
rely on the fact that the widgetset had been initialized (because the
Interfaces unit is usually one of the first used in the program file) and
thus will result in a crash during the initialization of the unit.
Again this does not happen with Delphi's VCL as there is no such widgetset
abstraction like the LCL has, because it directly accesses the WinAPI
(which is always there).

So I at least suggest you to split the GUI and non-GUI parts of the unit to
be on the really safe side.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151023/e5606a9b/attachment-0003.html>


More information about the Lazarus mailing list