Free Pascal Lazarus App Tutorial 2 - Shrinking The Application File Size


This tutorial shows how to shrink the file size of a Lazarus compiled app. As seen in Tutorial 1, the file size of the App was about 12 - 15 MB. A 12 – 15 MB app can be resized to about 1.5 MB using modified compiler options.

To Change the Compiler Options

1) Check the Smart Linkable Box
Project --> Project Options --> Compiler Options --> Code Generation --> Unit Style --> Smart Linkable(-CX)

2) Uncheck all Boxes in Debugging Except Strip Symbols From Executable
Within Project --> Project Options --> Compiler Options --> Linking --> Debugging
-Uncheck All Boxes Except - Strip Symbols From Executable (-Xs)

3) Check the Link Smart Box
Project --> Project Options --> Compiler Options --> Linking --> Link Style --> Link Smart (-XX)

Code Download
Tutorial 1 code is used within this tutorial. Tutorial 2 does not modify any code.