How to decrease executable size in Lazarus

To decrease executable size in FreePascal/Lazarus go to Project menu/Project Options and do the following in Compliation and Linking

Check the following (Red Underlined)


In Debuggin section of Complier options do the following:

  • Uncheck Generate debuggin info for GDB
  • Check Strip symbols from executables




5 thoughts on “How to decrease executable size in Lazarus

  1. i dont have option of code generation in my ide 1.2.2
    then what can i do???
    pls help me………..

  2. Yes. That’s one way to do it. But from Lazarus v1.2 there is even an easier and more logical way of managing exe file size and also keeping the debugging option. This feature is great for managing a “Release” mode for creating exe for distribution. And a “Debugging” mode for catching and squashing nasty bugs! You can switch when you need it.

    – Go to Project-> Project Options-> Compiler options
    – Click the […] button
    – Click “Create Release and Debug modes” button

    Now you will notice a new “cog” icon in the toolbar. Clicking the arrow beside it will let you select either “Release” and “Debug” mode, according to your choice. Just Run/Build the project to check out the result. That would make life a lot simpler, right?

    There are other quick ways to do reduce exe size for any project. And the exe can be even more shrunk down in size (down to ~700kb for a basic program). Details here:

  3. شكرا لكم كنت و لا ازال متابعا مهتما بابداعاتك
    هذه من الاشياء المهمة في لازاروس خاصة عند انتاج الاصدار النهائي

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s