I’m new to lazarus, it’s a great replacement for delphi IDE. I was amazed in the first place how lazarus as a freeware work great on linux. Only, i have one tiny problem with lazarus which is as default lazarus included the debug info and libraries on every project which caused the compiled file size become so large. Even just fot a simple “hello world” GUI application, the compiled application can growth into more than 21 Mb. Pretty waste of space for only a hello world application.
But it was only for active development process. On lazarus application production, debug info should be removed in order to reduce the file size as small as possible. I can’t imagine how big the application size will be if more complicated project is compiled on lazarus with debug info on it.
Free Pascal uses GDB as debugger and LD as linker. These work with a system of in-binary debuginfo, be it stabs or dwarf. People often see e.g. Lazarus binaries that are 40MB. The correct size should be about 6MB, the rest is debuginfo (and maybe 6 MB from not smartlinking properly) – (wiki.freepascal.org).
Since i’m a newbie on lazarus and i don’t really understand how to debug the codes, i prefer to remove the debugging info from compiled application.
At first i was reducing compiled file with strip and upx compressor command line which reduced the 20mb application down to 3mb. But then i saw lazarus faq which informing the better setting to reduce file size.
According to lazarus faq page there are 4 steps to reduce compiled binaries, that is:
This option work better for Win32 Aplication even without upx compression.