Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6564653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:59:39+00:00 2026-05-25T13:59:39+00:00

Using Delphi (or in general any tools, if exist of course), is it possible

  • 0

Using Delphi (or in general any tools, if exist of course), is it possible to reduce size of an exe file, removing all code that not is used but that is present there?
(for example, a function or procedure that is present but is never called).
I remember that with Pascal, using unit (without objects) the compiler includes only procedures and functions that are really used and will strip out non-used routines in a unit from the final exe.

With Object-pascal, I remember that in Delphi 1 all members of a object are included in the exe;
Has something has changed since than till Delphi-XE2?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:59:39+00:00Added an answer on May 25, 2026 at 1:59 pm

    If you aren’t using RTTI you can add this to the top of your .dpr file (immediately after program) to remove the extra RTTI information:

    {$IFOPT D-}{$WEAKLINKRTTI ON}{$ENDIF}
    {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
    

    If you want to strip it out of all the RTL/VCL units then you’d need to include those in your project file too so that the settings above could take effect. I don’t think I would recommend doing that since I don’t believe the reduction in executable size is worth the complications of compiling your own RTL/VCL.

    You can also add the following, again somewhere in your .dpr file:

    {$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED}
    

    This will strip the relocation information which is not needed in a .exe. Don’t add this to a DLL or package!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a code coverage tool using Delphi 2007. My general
Using Delphi 2007 I can write the following code: interface TTestType = (ttTest1, ttTest2);
I am using Delphi, but this is a simple and general problem: I'm doing
I am using Delphi 2009. I want to view the contents of a file
(Using Delphi 5) I am attempting to open a log file using the following
Using Delphi 2009 on Windows XP to develop desktop application. Is there any way
I'm using TNMHTTP in Delphi to retrieve the code from a webpage. The code
Using Delphi XE, TZipMaster 1.91 (latest) I want to get the file name of
When using Delphi, any version, I sometimes happen to hit the insert key and
Using Delphi 07 is it possible to (How do I) get the handle of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.