[fpc-pascal] Will the size of an executable depend on the uses clause

Michael Van Canneyt michael at freepascal.org
Wed Jun 16 12:08:26 CEST 2021

On Wed, 16 Jun 2021, Tomas Hajny via fpc-pascal wrote:

> On 2021-06-16 11:38, Marco van de Voort via fpc-pascal wrote:
>> Op 2021-06-16 om 11:21 schreef Tomas Hajny via fpc-pascal:
>>>  Or if they contain $R inclusions.
>>> ...or many other things which may not be smartlinked, either because 
>>> it is not possible, or because the compiler and/or linker cannot do it 
>>> right now.
>> Yes. But it is good to keep the things that fundamentally can't be
>> smartlinked (like init sections and resource files) apart from the
>> ones that might not be smartlinkable  yet, which is only a temporary
>> assessment of a target.
> Well, as an example - if you add FV units App and Views to your uses 
> clause, it increases the binary size for mainstream targets as well, 
> although these units don't contain initialization sections nor $R 
> inclusions. The best recommendation is IMHO different - just pay 
> attention to which units you really need/use rather than using a general 
> collection.

FPC/lazarus tell you which units are unused, and in the Lazarus IDE you can use the
quick actions of the message dialog to quickly remove all unused units.
I use it all the time.


More information about the fpc-pascal mailing list