[Lazarus] Large program size - 1.8 MB for empty GUI project

Florian Klaempfl florian at freepascal.org
Wed Apr 8 20:29:51 CEST 2009

Reenen Laurie schrieb:
> 2009/4/8 Alexey S. Smirnov <betatester at rambler.ru>:
>> The Smart Link process should check what variables/functions/definitions are
>> used in your project to cut off unused code. It is really simple to do so,
>> if some units are listed in Implementation section - linker will only add
>> unit functions that are mentioned in you code, not more.
>> If units are listed in Interface section - it mean that potentially all
>> code  from that particular unit should be included. Because your global
>> variable/class should have access to all provided
>> code/procedures/properties.
> Marc Weustink (i think wrote):
>> Just a note: some people think that units can be compiled in one pass -
>> this is not true. The compiler must stop on every Uses clause, and
> So .exe's should be (much) smaller if your uses units are put mostly
> in implementation (not easy to find circular references), but we say
> rather put it in interface?

No. The location where a unit is included (interface/implementation)
does not matter for smartlinking. If you really want try to drop exe
size, play with the whole program optimization implemented by Jonas in

More information about the Lazarus mailing list