<p>Am 23.10.2015 14:29 schrieb "Bo Berglund" <<a href="mailto:bo.berglund@gmail.com">bo.berglund@gmail.com</a>>:<br>
> So I am a bit surprised that just using this unit would make the FPC<br>
> command program not work...</p>
<p>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.<br>
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).<br>
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.<br>
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).</p>
<p>So I at least suggest you to split the GUI and non-GUI parts of the unit to be on the really safe side.</p>
<p>Regards,<br>
Sven</p>