Recent

Author Topic: Smaller Compile  (Read 3607 times)

roger_russelburg

  • Newbie
  • Posts: 2
Smaller Compile
« on: April 15, 2016, 12:35:00 am »
I am an amateur programmer. When I compile with Delph1 7 I get an exe file of 422KB. When I compile with Lazerus I get an exe of 2390KB. How do get a smaller exe file when the program final.
Thanks Roger

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Smaller Compile
« Reply #1 on: April 15, 2016, 01:14:47 am »
Ah, the forever 1 million dollar question  ;D

All the answers to that topic can be read here.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8776
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Smaller Compile
« Reply #2 on: April 15, 2016, 09:31:40 am »
Ah, the forever 1 million dollar question  ;D

All the answers to that topic can be read here.
Should start from FAQ ;)
http://wiki.lazarus.freepascal.org/Lazarus_Faq#Why_are_the_generated_binaries_so_big.3F

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11947
  • FPC developer.
Re: Smaller Compile
« Reply #3 on: April 15, 2016, 09:59:33 am »
I am an amateur programmer. When I compile with Delph1 7 I get an exe file of 422KB. When I compile with Lazerus I get an exe of 2390KB. How do get a smaller exe file when the program final.

That is simple: Use Delphi 7, if binary sizes are all that matters.

Thaddy

  • Hero Member
  • *****
  • Posts: 16199
  • Censorship about opinions does not belong here.
Re: Smaller Compile
« Reply #4 on: April 15, 2016, 10:00:24 am »
I am an amateur programmer. When I compile with Delph1 7 I get an exe file of 422KB. When I compile with Lazerus I get an exe of 2390KB. How do get a smaller exe file when the program final.
Thanks Roger
Well, you are using the Rolls-Royce of the Delphi versions (7)... ( Yes it was that good while it lasted)
But when you have the correct compiler settings FPC should not be that far off and the generated executable is at least as fast as D7.
Size does not matter too much. Try these compiler options: -CX -XX -Xs -Os and your executable should be within a 25% margin either way.
« Last Edit: April 15, 2016, 10:03:01 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Smaller Compile
« Reply #5 on: April 15, 2016, 02:50:52 pm »
Hi Roger,

This example by skalogryz might explain something.

roger_russelburg

  • Newbie
  • Posts: 2
Re: Smaller Compile
« Reply #6 on: April 15, 2016, 07:25:00 pm »
I want thank everyone for there help. I thought I was doing something wrong.
I can live larger files. I am using Lazarus 1.6 and Free Pascal 3.0.

Thanks Roger

 

TinyPortal © 2005-2018