Recent

Author Topic: EXE Size - No effect  (Read 6375 times)

mm_coder

  • Jr. Member
  • **
  • Posts: 50
EXE Size - No effect
« on: February 01, 2018, 07:21:05 pm »
I'm compiling a lNet smtp sample program, and no matter how I set the debugger option etc, the smtptest.exe
stays at 16mb.
Any ideas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: EXE Size - No effect
« Reply #1 on: February 01, 2018, 07:33:49 pm »
The option for "debug info" is only for your own code.

The same option exists for every package (like LCL, ...)
So those may still have debug info.

Use strip.
If the option in the IDE does not work, then run strip yourself on the final exe.

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: EXE Size - No effect
« Reply #2 on: February 01, 2018, 07:37:55 pm »
Quote
Project -> Project Options -> Compiler Options ->
Change Build Modes -> Default -> By  ... <- Pressing Button
Click -> Create Debug and Release Modes -> Press OK
And In Build Modes -> Select Release and build your project

By default programs are built with debug information so the size of the exe is big. Not to worry..  :)
Holiday season is online now. :-)

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: EXE Size - No effect
« Reply #3 on: February 01, 2018, 09:18:14 pm »
A simple smtp example should be around 200-300K or less. Last week I gave one using synapse.
But anyway: strip the debug info.
Specialize a type, not a var.

mm_coder

  • Jr. Member
  • **
  • Posts: 50
Re: EXE Size - No effect
« Reply #4 on: February 02, 2018, 12:21:03 am »
Awesome comments, but before I use the strip technique.
Any chance these two warnings are screwing my compile option settings.

Warning: other sources path of "smtptest" contains "C:\lazarus\lcl", which belongs to package "LCLBase"
Warning: other sources path of package "lnetbase 0.6.6" contains directory "..\lib", which is already in the unit search path.

I remember the compiler settings made a difference before updating to 1.8

mm_coder

  • Jr. Member
  • **
  • Posts: 50
Re: EXE Size - No effect
« Reply #5 on: February 02, 2018, 12:42:40 am »
Just now to test. I have another application that integrates with Sage 100 ERP. Was 24mb, after I changed the
debug settings to release settings...now it's 2mb. So it works. I just have something whacked in this project.
This is my goto environment now. Trying to get to green belt

mm_coder

  • Jr. Member
  • **
  • Posts: 50
Re: EXE Size - No effect
« Reply #6 on: February 03, 2018, 03:15:51 am »
I built a new project, and the executable is 1.9mb. I'm happy with that.

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: EXE Size - No effect
« Reply #7 on: February 03, 2018, 05:26:01 am »
What about this ?.... // I guess it's the standard (recommended) way ....  :)
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: EXE Size - No effect
« Reply #8 on: February 03, 2018, 05:36:26 am »
BTW:
Is there a reason why this is not the standard configuration after the installation ???
Two modes: 1. DEBUG, 2. RELEASE and the RELEASE MODE is activated by default.

Let me guess... nobody would ever ask something like this again...  :P
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: EXE Size - No effect
« Reply #9 on: February 03, 2018, 08:29:25 am »
No, you will get the exact opposite: why can't I debug my program... LOL  8-)
Specialize a type, not a var.

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: EXE Size - No effect
« Reply #10 on: February 03, 2018, 02:10:26 pm »
That's possible !  :D
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: EXE Size - No effect
« Reply #11 on: February 03, 2018, 02:38:24 pm »
BTW:
Is there a reason why this is not the standard configuration after the installation ???
Two modes: 1. DEBUG, 2. RELEASE and the RELEASE MODE is activated by default.

Let me guess... nobody would ever ask something like this again...  :P

I think because you can customize the settings in the Project Options for each kind of build. So if you come with already made modes, you need to configure each one every single change you do.

And there is an option 'make debug and release' when there is a single mode available (default), I think these just add the release stuff and keep your own settings for debug and release.

mm_coder

  • Jr. Member
  • **
  • Posts: 50
Re: EXE Size - No effect
« Reply #12 on: February 03, 2018, 09:00:16 pm »
I searched the forum and found the standard recommendations, including debug/release config etc. But
my exe size never changed. My other projects do change when switching to debug/release. So the option is
having it's desired effect.

As a new user, I'm sure there was some other thing I was doing wrong which prevented the configuration changes to have it's desired effect.

So I created a new project (which I need to get good at anyway), and all is good. I'm better off now.
Thanks all

 

TinyPortal © 2005-2018