Discussion:
Lazarus File bigger then Delphi File?
Gandi Wibowo
2006-05-09 07:55:56 UTC
Permalink
Hai every body,
I'm sorry if you'r dificult to understand my english. It's not my
mother language.

I'm Win32 Delphi Programmer, and want to try codding in LINUX using delphi.
I was trying Kylix and get alot of problem, So i try to use lazarus.

I try it in windows first, but it's suprissing me. i make some program
with one window and no other component (i open lazarus, create new
project, save the project and compile it). and lazarus make an execute
file with size 6 MB.
I do the same to delphi, it only 300 KB.

Why it happend?
Jonas A.
2006-05-09 08:07:47 UTC
Permalink
Post by Gandi Wibowo
file with size 6 MB.
I do the same to delphi, it only 300 KB.
Here is your answer:
http://wiki.lazarus.freepascal.org/index.php/Lazarus_Faq#Why_are_the_generated_binaries_so_big.3F
Bogusław Brandys
2006-05-09 08:28:19 UTC
Permalink
Post by Gandi Wibowo
Hai every body,
I'm sorry if you'r dificult to understand my english. It's not my
mother language.
I'm Win32 Delphi Programmer, and want to try codding in LINUX using delphi.
I was trying Kylix and get alot of problem, So i try to use lazarus.
I try it in windows first, but it's suprissing me. i make some program
with one window and no other component (i open lazarus, create new
project, save the project and compile it). and lazarus make an execute
file with size 6 MB.
I do the same to delphi, it only 300 KB.
Why it happend?
Are you using Lazarus 0.9.14 version or older ? There is a bug which
cause that strip not called to remove debug info from EXE.
Just do from command line:

strip.exe (not striptease ;-) ) --remove-all project.exe


Regards
Bogusław Brandys
Bogusław Brandys
2006-05-09 08:38:48 UTC
Permalink
Post by Bogusław Brandys
Post by Gandi Wibowo
Hai every body,
I'm sorry if you'r dificult to understand my english. It's not my
mother language.
I'm Win32 Delphi Programmer, and want to try codding in LINUX using delphi.
I was trying Kylix and get alot of problem, So i try to use lazarus.
I try it in windows first, but it's suprissing me. i make some program
with one window and no other component (i open lazarus, create new
project, save the project and compile it). and lazarus make an execute
file with size 6 MB.
I do the same to delphi, it only 300 KB.
Why it happend?
Are you using Lazarus 0.9.14 version or older ? There is a bug which
cause that strip not called to remove debug info from EXE.
strip.exe (not striptease ;-) ) --remove-all project.exe
Regards
Bogusław Brandys
Sorry.Should be:

strip --strip-all project.exe



Regards
Boguslaw
Gandi Wibowo
2006-05-10 08:19:00 UTC
Permalink
Post by Bogusław Brandys
strip --strip-all project.exe
It's only reduce a half, the file size is still bigger than delphi.
It's 3+ MB
Gandi Wibowo
2006-05-10 08:25:03 UTC
Permalink
Post by Bogusław Brandys
strip --strip-all project.exe
It's only reduce a half, the file size is still bigger than delphi.
It's 3+ MB
Jonas A.
2006-05-10 13:48:42 UTC
Permalink
Post by Gandi Wibowo
It's only reduce a half, the file size is still bigger than delphi.
It's 3+ MB
need smaller? :)
http://upx.sourceforge.net/

startlazarus.exe after "strip --strip-all" and "upx -9" 544kB
S0vNarK0m
2006-05-10 13:55:51 UTC
Permalink
Upx is a trick, try to upx Delphi exe
Post by Jonas A.
Post by Gandi Wibowo
It's only reduce a half, the file size is still bigger than delphi.
It's 3+ MB
need smaller? :)
http://upx.sourceforge.net/
startlazarus.exe after "strip --strip-all" and "upx -9" 544kB
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
--
---
Фата либен
Jonas A.
2006-05-10 14:03:02 UTC
Permalink
let me ask you a few questions:
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec linux+windows?
buy delphi, buy kylix, have a hard time porting everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?

ion
Post by Jonas A.
Post by Gandi Wibowo
It's only reduce a half, the file size is still bigger than delphi.
It's 3+ MB
need smaller? :)
http://upx.sourceforge.net/
startlazarus.exe after "strip --strip-all" and "upx -9" 544kB
Gandi Wibowo
2006-05-11 10:23:56 UTC
Permalink
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec linux+windows?
buy delphi, buy kylix, have a hard time porting everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
I can't say anything.
George Birbilis
2007-01-17 15:15:23 UTC
Permalink
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k
modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec
linux+windows?
buy delphi, buy kylix, have a hard time porting
everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
I can't say anything.
I know this is an old thread, but regarding Delphi silly .exe bloating, for
command-line apps, if you removed some units like forms or sysutils and uses
windows unit (and respective API - even for just one call to MessageBox
instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.
Pretty crazy, maybe fixed at versions after Delphi7 (had told Borland guys
about it). Either the compiler didn't remove unused classes/code (in favor
of RTTI and dynamic stuff or something?) or it was some resources linked in.

In some case I had found that moving such units from interface to
implementation section at my units that the project was using it made the
size much smaller for the .exe

----------------
George Birbilis (***@kagi.com)
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com




_____

avast! Antivirus <http://www.avast.com> : Outbound message clean.


Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 5:15:23 ??
avast! - copyright (c) 1988-2007 ALWIL Software.
Graeme Geldenhuys
2007-01-18 07:10:39 UTC
Permalink
In the real world, bigger is always better! Well, that's the American
way of thinking. How come that doesn't apply for Lazarus executables!
:-)


Graeme.
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k
modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec
linux+windows?
buy delphi, buy kylix, have a hard time porting
everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
a***@siteland.it
2007-01-18 08:19:33 UTC
Permalink
Post by Graeme Geldenhuys
In the real world, bigger is always better! Well, that's the American
way of thinking. How come that doesn't apply for Lazarus executables!
:-)
Graeme.
In Italy, we think that a big gun is useless if you don't know how to
use it :-)
Florian Klaempfl
2007-01-18 07:55:17 UTC
Permalink
Post by George Birbilis
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k
modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec
linux+windows?
buy delphi, buy kylix, have a hard time porting
everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
I can't say anything.
I know this is an old thread, but regarding Delphi silly .exe bloating, for
command-line apps, if you removed some units like forms or sysutils and uses
windows unit (and respective API - even for just one call to MessageBox
instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.
The abstraction layers of sysutils and classes simply require space. Either
people has to live with it or don't use it. E.g. a simple uses of sysutils pulls
in a lot of code because of the rte to exception conversion including a lot of
resourcestrings etc.
Post by George Birbilis
Pretty crazy, maybe fixed at versions after Delphi7 (had told Borland guys
about it). Either the compiler didn't remove unused classes/code (in favor
of RTTI and dynamic stuff or something?) or it was some resources linked in.
Smartlinking with classes having virtual methods is not working because the
compiler _can't_ know which methods are actually unused.
Post by George Birbilis
In some case I had found that moving such units from interface to
implementation section at my units that the project was using it made the
size much smaller for the .exe
----------------
Computer & Informatics Engineer
Microsoft MVP J# for 2004-2007
Borland "Spirit of Delphi"
3D, QuickTime, QTVR, Java, Delphi,
ActiveX, .NET components, Robotics
http://www.kagi.com/birbilis
http://birbilis.spaces.live.com
_____
avast! Antivirus <http://www.avast.com> : Outbound message clean.
Virus Database (VPS): 0703-0, 13/01/2007
Tested on: 17/1/2007 5:15:23 ??
avast! - copyright (c) 1988-2007 ALWIL Software.
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
m2
2007-01-18 23:26:30 UTC
Permalink
Post by Florian Klaempfl
Post by George Birbilis
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k
modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec
linux+windows?
buy delphi, buy kylix, have a hard time porting
everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
I can't say anything.
I know this is an old thread, but regarding Delphi silly .exe bloating, for
command-line apps, if you removed some units like forms or sysutils and uses
windows unit (and respective API - even for just one call to MessageBox
instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.
The abstraction layers of sysutils and classes simply require space. Either
people has to live with it or don't use it. E.g. a simple uses of sysutils pulls
in a lot of code because of the rte to exception conversion including a lot of
resourcestrings etc.
Yes but this is not the only explanation. For instance, consider the
following small function

function IWeight(A: PBigInt): SInt32;
begin
Result := RawWeight(A^.Digits,A^.Size);
end;

When it is not inlined, Turbo Delphi codes it this way:

push ebp
mov ebp, esp
mov edx, [eax+$08]
mov eax, [eax]
call RawWeight
pop ebp
ret

That's almost perfect. Now, here is the way Free Pascal (2.0.4) codes
it:

push ebp
mov ebp, esp
sub esp, 8
mov [ebp-8], ebx
mov [ebp-4], esi
mov ebx, eax
mov edx, [ebx+8]
mov eax, [ebx]
call KERNEL_RAWWEIGHT$PUINT32$LONGINT$$LONGINT
mov esi, eax
mov ebx, [ebp-8]
mov esi, [ebp-4]
leave
ret

This is simply catastrophic. There are 7 useless instructions, 7 out of
14. Here, the code is twice bigger and this has nothing to do with
resourcestrings.
Btw, why does Free Pascal make use of the esi register?

M. Martin
Florian Klaempfl
2007-01-19 08:06:52 UTC
Permalink
Post by m2
Post by Florian Klaempfl
Post by George Birbilis
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k
modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec
linux+windows?
buy delphi, buy kylix, have a hard time porting
everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
I can't say anything.
I know this is an old thread, but regarding Delphi silly .exe bloating, for
command-line apps, if you removed some units like forms or sysutils and uses
windows unit (and respective API - even for just one call to MessageBox
instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.
The abstraction layers of sysutils and classes simply require space. Either
people has to live with it or don't use it. E.g. a simple uses of sysutils pulls
in a lot of code because of the rte to exception conversion including a lot of
resourcestrings etc.
Yes but this is not the only explanation. For instance, consider the
following small function
function IWeight(A: PBigInt): SInt32;
begin
Result := RawWeight(A^.Digits,A^.Size);
end;
push ebp
mov ebp, esp
mov edx, [eax+$08]
mov eax, [eax]
call RawWeight
pop ebp
ret
That's almost perfect.
Look below what's perfect.
Post by m2
Now, here is the way Free Pascal (2.0.4) codes
push ebp
mov ebp, esp
sub esp, 8
mov [ebp-8], ebx
mov [ebp-4], esi
mov ebx, eax
mov edx, [ebx+8]
mov eax, [ebx]
call KERNEL_RAWWEIGHT$PUINT32$LONGINT$$LONGINT
mov esi, eax
mov ebx, [ebp-8]
mov esi, [ebp-4]
leave
ret
This is simply catastrophic. There are 7 useless instructions, 7 out of
14. Here, the code is twice bigger and this has nothing to do with
resourcestrings.
2.x got a completely new register allocator which fits the needs of CISC and
RISC CPUs. We didn't have the time in 2.0.x times to take full advantage of this
register allocator. 2.1.1 does much better:

.section .text.n_p$program_iweight$pbigint$$longint
.balign 16,0x90
.globl P$PROGRAM_IWEIGHT$PBIGINT$$LONGINT
P$PROGRAM_IWEIGHT$PBIGINT$$LONGINT:
# Temps allocated between esp+0 and esp+0
# Var A located in register eax
# Var $result located in register eax
# [18] begin
# [19] Result := RawWeight(A^.Digits,A^.Size);
movl 4(%eax),%edx
movl (%eax),%eax
call P$PROGRAM_RAWWEIGHT$LONGINT$LONGINT$$LONGINT
# [20] end;
ret

though pure instruction count doesn't matter much for modern CPUs.
Post by m2
Btw, why does Free Pascal make use of the esi register?
Because nobody provides compilable examples and you didn't use -O3r :)?
m2
2007-01-19 12:24:45 UTC
Permalink
Post by Florian Klaempfl
Post by m2
Post by Florian Klaempfl
Post by George Birbilis
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k
modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
btw, delphi is NOT multiplatform. whant smaller exec
linux+windows?
buy delphi, buy kylix, have a hard time porting
everything and tuning
everything to work similar.
size is a cost of multiplatform and RAD+functionality power.
enough arguments? or should i add more?
I can't say anything.
I know this is an old thread, but regarding Delphi silly .exe bloating, for
command-line apps, if you removed some units like forms or sysutils and uses
windows unit (and respective API - even for just one call to MessageBox
instead of ShowMessage) the .EXE would become say 50kb instead of 500kb.
The abstraction layers of sysutils and classes simply require space. Either
people has to live with it or don't use it. E.g. a simple uses of sysutils pulls
in a lot of code because of the rte to exception conversion including a lot of
resourcestrings etc.
Yes but this is not the only explanation. For instance, consider the
following small function
function IWeight(A: PBigInt): SInt32;
begin
Result := RawWeight(A^.Digits,A^.Size);
end;
push ebp
mov ebp, esp
mov edx, [eax+$08]
mov eax, [eax]
call RawWeight
pop ebp
ret
That's almost perfect.
Look below what's perfect.
Post by m2
Now, here is the way Free Pascal (2.0.4) codes
push ebp
mov ebp, esp
sub esp, 8
mov [ebp-8], ebx
mov [ebp-4], esi
mov ebx, eax
mov edx, [ebx+8]
mov eax, [ebx]
call KERNEL_RAWWEIGHT$PUINT32$LONGINT$$LONGINT
mov esi, eax
mov ebx, [ebp-8]
mov esi, [ebp-4]
leave
ret
This is simply catastrophic. There are 7 useless instructions, 7 out of
14. Here, the code is twice bigger and this has nothing to do with
resourcestrings.
2.x got a completely new register allocator which fits the needs of CISC and
RISC CPUs. We didn't have the time in 2.0.x times to take full advantage of this
.section .text.n_p$program_iweight$pbigint$$longint
.balign 16,0x90
.globl P$PROGRAM_IWEIGHT$PBIGINT$$LONGINT
# Temps allocated between esp+0 and esp+0
# Var A located in register eax
# Var $result located in register eax
# [18] begin
# [19] Result := RawWeight(A^.Digits,A^.Size);
movl 4(%eax),%edx
movl (%eax),%eax
call P$PROGRAM_RAWWEIGHT$LONGINT$LONGINT$$LONGINT
# [20] end;
ret
Great. I do hope that the next stable version will generate such a code.

M. Martin

roozbeh gholizadeh
2006-05-15 09:50:53 UTC
Permalink
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
Well apparently this is not a good reason!
In wince my exe files with lazarus is about 14mg and after strip about
3-4mg,i dont think for a device with 12mg or 16mg memory,and at best 20mg
storage room a 4-5mg exe is good!
So yes in this case we are using 1.44 floppies and yes we are sending
compile exes with less than 56kb modem to phone devices
so 1-2mg bigger is not bad,it is worst!
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Bogusław Brandys
2006-05-17 11:21:47 UTC
Permalink
Post by roozbeh gholizadeh
Post by Jonas A.
are you still using 1.44 floppies?
are you sending compiled execs 20 times a day via 56k modem connection?
no? then why 1 or 2 mb bigger is so bad for you?
Well apparently this is not a good reason!
In wince my exe files with lazarus is about 14mg and after strip about
3-4mg,i dont think for a device with 12mg or 16mg memory,and at best
20mg storage room a 4-5mg exe is good!
So yes in this case we are using 1.44 floppies and yes we are sending
compile exes with less than 56kb modem to phone devices
so 1-2mg bigger is not bad,it is worst!
Maybe create KOL based widgetset for Lazarus or simply use KOL
(http://xcl.cjb.net) for WinCE ? I have quite complicated message
application with sqlite storage all in about 297 Kb EXE without
compression under Windows XP.
Perfect for Windows CE and other devices. Unfortunately it's only for
WinAPI but compiles fine using FPC.


Regards
Boguslaw Brandys
Felipe Monteiro de Carvalho
2006-05-17 19:04:04 UTC
Permalink
Post by Bogusław Brandys
Maybe create KOL based widgetset for Lazarus
Won't solve anything. LCL is too big. There are too many features, and
thus pascal units to be linked to get lcl working, so any LCL
widgetset will generate big executables.

What would help is really powerful smartlinking (being able to rip
unused methods inside a unit for example).

LCL adds some things, like being able to load a form from XML. This
requires a parser, and parsers are big, so this adds size to software.
The final size is a big sum of all the features. A powerful
smartlinking would kill all unecessary stuff.
Post by Bogusław Brandys
or simply use KOL (http://xcl.cjb.net) for WinCE ?
Now this would make software smaller. But then you loose the
cross-platform hability, the form designer and LCL component
repository.

thanks,
--
Felipe Monteiro de Carvalho
Mattias Gaertner
2006-05-17 19:57:48 UTC
Permalink
On Wed, 17 May 2006 16:04:04 -0300
Post by Felipe Monteiro de Carvalho
Post by Bogusław Brandys
Maybe create KOL based widgetset for Lazarus
Won't solve anything. LCL is too big. There are too many features, and
thus pascal units to be linked to get lcl working, so any LCL
widgetset will generate big executables.
Ehm. The widgetsets are in no way optimized for smartlinking. I guess, by
optimizing a few things we can easily reduce the size by half.
Post by Felipe Monteiro de Carvalho
What would help is really powerful smartlinking (being able to rip
unused methods inside a unit for example).
Won't help. For example at the moment the gtk callbacks use case statements
with all kind of controls. This must be improved.
Post by Felipe Monteiro de Carvalho
LCL adds some things, like being able to load a form from XML. This
requires a parser, and parsers are big, so this adds size to software.
True. But this makes less than 5% of the code.
Post by Felipe Monteiro de Carvalho
The final size is a big sum of all the features. A powerful
smartlinking would kill all unecessary stuff.
Post by Bogusław Brandys
or simply use KOL (http://xcl.cjb.net) for WinCE ?
Now this would make software smaller. But then you loose the
cross-platform hability, the form designer and LCL component
repository.
Mattias
Tony Maro
2006-05-17 20:17:00 UTC
Permalink
Post by Mattias Gaertner
Won't help. For example at the moment the gtk callbacks use case statements
with all kind of controls. This must be improved.
Post by Felipe Monteiro de Carvalho
LCL adds some things, like being able to load a form from XML. This
requires a parser, and parsers are big, so this adds size to software.
True. But this makes less than 5% of the code.
Post by Felipe Monteiro de Carvalho
The final size is a big sum of all the features. A powerful
smartlinking would kill all unecessary stuff.
I know this isn't what everyone is really wanting to hear when they're
discussing this, but I'll add my $.02 USD into the discussion more from
an esoteric corporate view than a lazarus coding view.

I wrote TruckBytes using Lazarus. It's a full featured graphically
pleasing database application designed to run a trucking company. The
total download is around 2 MB compressed, including the SSL libraries I
redistribute.

An equivalent program written using Visual C++ in a Microsoft
environment would never see the light of day for less than 20 MB. The
database engine alone would probably be 3/4 of the total distributed
program. If done in VB, the runtimes for VB alone would be large. Sure
you could force your users to download it separately, but if you want to
reduce customer support issues you distribute everything you need.

Back to TruckBytes. The EXE is around 3.9 MB all said and done, plus
supporting SSL dll's for the Windows version. I have 200 GB of hard
disk space. I have 2 GB of RAM. I have 3 Mb download speed. If I was
a nut about trying to reduce EXE size I'd use a macro assembler and a
6502 processor (yes, I've done that before.)

"Bloat" used to be an issue in code when the code was pushing the limits
of what the computers could handle. Sure you can talk about "bloat"
like it's still a horrible problem, but when it comes down to it the
question is do I want to waste 4 months or more of development to reduce
code size or use some preconfigured "lego blocks" that produce a larger
EXE? I'll go for the 4 months of man-hours saved.

Of course that's a corporate view and really holds no bearing on the
discussion of how to reduce the LCL size, I just want to point out that
1 MB exe versus 4 MB exe really doesn't make a darn bit of difference
unless your computer was built in the mid 90's. Or you're simply
writing a console app, in which case you shouldn't use the LCL anyway.

Keep in mind I'm not saying use this to justify NOT optimizing the LCL
or smartlinking. I'm just saying weigh the time spent coding where it's
best utilized, for instance GTK2, QT, OSX, better compatibility or bug
squishing.

The above statement's obviously don't apply if you're writing for
PocketPC / Windows Mobile.

-Tony
L505
2006-05-17 20:19:16 UTC
Permalink
Post by Felipe Monteiro de Carvalho
What would help is really powerful smartlinking (being able to rip
unused methods inside a unit for example).
Theres no such thing, that is what smartlinking is - KOL is designed around this but many
people hate KOL because it uses old Objects and requires a bit of thinking - and most
people could care less about Exe size - I happen to care a bit, because the first
impression of the user is always important - I'm not anal about using KOL for every app,
but I use it lots.. it's fun to have a challenge to write a KOL app instead of it being so
easy too - but I'm crazy - only crazy people use KOL. Boguslaw is crazy too and so is
Thaddy. Don't use KOL unless you are crazy and like being crazy :-)
Marco van de Voort
2006-07-30 13:06:14 UTC
Permalink
Post by Felipe Monteiro de Carvalho
Won't solve anything. LCL is too big. There are too many features, and
thus pascal units to be linked to get lcl working, so any LCL
widgetset will generate big executables.
What would help is really powerful smartlinking (being able to rip
unused methods inside a unit for example).
I tried this once, but don't expect this to be more than 10%. The resulting
binary was not even working, so probably too much was cut.
Post by Felipe Monteiro de Carvalho
Post by Bogusław Brandys
or simply use KOL (http://xcl.cjb.net) for WinCE ?
Now this would make software smaller. But then you loose the
cross-platform hability, the form designer and LCL component
repository.
Size should not be the discussion. If LCL is overkill, so be it, but then
first formulate the requirements, and then start matching alternatives.

I've some doubts about using Lazarus on very small displays anyway due to
screen real estate issues.
Nataraj S Narayan
2006-07-31 06:02:07 UTC
Permalink
Hi

Getting the following when given 'make clean all;'.

newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
***@edubuntu:~/lazarus#

Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.

regards

Nataraj
Funky Beast
2006-07-31 07:16:49 UTC
Permalink
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
regards
Nataraj
I think the Math unit is missing in the uses section.
A quick fix would be to add "Math" to the uses section of newfield.pas
as you can find the function there.

Regards
Funky Beast
Graeme Geldenhuys
2006-07-31 07:33:34 UTC
Permalink
Hi Funky Beast,

Actually looking at the error message... You are right. The Min()
function is not found, which would suggest the Math unit is missing
from the uses clause.

Thanks for pointing that out. It will teach me to read the message
completely before replying. :-)

Regards,
Graeme.
Post by Funky Beast
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
regards
Nataraj
I think the Math unit is missing in the uses section.
A quick fix would be to add "Math" to the uses section of newfield.pas
as you can find the function there.
Regards
Funky Beast
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
--
There's no place like 127.0.0.1
C Western
2006-07-31 07:25:13 UTC
Permalink
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
This seems to have been introduced in the latest svn. Fix by adding
"Uses Math;" to the unit
Colin
Mattias Gaertner
2006-07-31 07:39:02 UTC
Permalink
On Mon, 31 Jul 2006 11:32:07 +0530
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
Fixed. Please update svn and compile again.

Mattias
Nataraj S Narayan
2006-07-31 08:40:04 UTC
Permalink
Hi Mattias

That's fixed! Thanx. But my major problem is unsettled.
Still getting all the properties vanish at run-time.

Example :- For the following compo, I had set all the properties like
Database name and got it displaying data in dbgrid. But after compile it
is not showing any of the properties,

object SQLQuery1: TSQLQuery
left = 168
top = 144
end

Plz help

regards

Nataraj
Post by Mattias Gaertner
On Mon, 31 Jul 2006 11:32:07 +0530
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
Fixed. Please update svn and compile again.
Mattias
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Mattias Gaertner
2006-07-31 09:45:16 UTC
Permalink
On Mon, 31 Jul 2006 14:10:04 +0530
Post by Nataraj S Narayan
Hi Mattias
That's fixed! Thanx. But my major problem is unsettled.
Still getting all the properties vanish at run-time.
It's a known bug in fpc 2.1.1. TWriter does not write some properties.
No one had yet the time to investigate it further.
Use fpc 2.0.2 or 2.0.4.


Mattias
Post by Nataraj S Narayan
Example :- For the following compo, I had set all the properties like
Database name and got it displaying data in dbgrid. But after compile it
is not showing any of the properties,
object SQLQuery1: TSQLQuery
left = 168
top = 144
end
Plz help
regards
Nataraj
Post by Mattias Gaertner
On Mon, 31 Jul 2006 11:32:07 +0530
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
Fixed. Please update svn and compile again.
Mattias
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Mattias Gaertner
2006-07-31 10:11:58 UTC
Permalink
On Mon, 31 Jul 2006 11:45:16 +0200
Post by Mattias Gaertner
On Mon, 31 Jul 2006 14:10:04 +0530
Post by Nataraj S Narayan
Hi Mattias
That's fixed! Thanx. But my major problem is unsettled.
Still getting all the properties vanish at run-time.
It's a known bug in fpc 2.1.1. TWriter does not write some properties.
No one had yet the time to investigate it further.
I took a look:
rtl/objpas/classes/writer.inc line 596

if IsStoredProp(Instance, PropInfo) then

IsStoredProp returns false for all properties without 'stored' procedure. To be more exact:
If ((PropInfo^.PropProcs shr 4) and 3) = ptconst then IsStoredProp always returns false. So PropInfo^.StoredProc is set always to false.
The function is the same as for fpc 2.0.x, so I guess, the compiler does not set the RTTI correct any more.
Hopefully this helps the compiler people to track down the bug.

Mattias
Post by Mattias Gaertner
Use fpc 2.0.2 or 2.0.4.
Mattias
Post by Nataraj S Narayan
Example :- For the following compo, I had set all the properties like
Database name and got it displaying data in dbgrid. But after compile it
is not showing any of the properties,
object SQLQuery1: TSQLQuery
left = 168
top = 144
end
Plz help
regards
Nataraj
Post by Mattias Gaertner
On Mon, 31 Jul 2006 11:32:07 +0530
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
Fixed. Please update svn and compile again.
Mattias
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Nataraj S Narayan
2006-07-31 11:12:39 UTC
Permalink
Mattias Gaertner
2006-07-31 17:39:21 UTC
Permalink
On Mon, 31 Jul 2006 16:42:39 +0530
Hi
Tried fpc-2.0.2. My TMySQL41Connection has vanished.
What to do now?
I don't know, if TMySQL41Connection works with fpc 2.0.2. If yes:

Check, that you really use fpc 2.0.2.
For example add
{$IFNDEF VER2_0}{$ERROR no}{$ENDIF}
and compile

Mattias
regards
Nataraj
Mattias Gaertner wrote:On Mon, 31 Jul 2006 14:10:04 +0530
Hi Mattias
That's fixed! Thanx. But my major problem is unsettled.
Still getting all the properties vanish at run-time.
It's a known bug in fpc 2.1.1. TWriter does not write some properties.
No one had yet the time to investigate it further.
Use fpc 2.0.2 or 2.0.4.
Mattias
Example :- For the following compo, I had set all the properties like
Database name and got it displaying data in dbgrid. But after compile it
is not showing any of the properties,
object SQLQuery1: TSQLQuery
left = 168
top = 144
end
Plz help
regards
Nataraj
On Mon, 31 Jul 2006 11:32:07 +0530
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
Fixed. Please update svn and compile again.
Mattias
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Alexandrov Alexandru
2006-07-31 18:29:26 UTC
Permalink
Instead of Math unit, better add a function:

function min(i,j: integer): integer;
begin
Result := i;
if j<i then Result := j;
end;


.. like was before?
Post by Mattias Gaertner
On Mon, 31 Jul 2006 11:32:07 +0530
Post by Nataraj S Narayan
Hi
Getting the following when given 'make clean all;'.
newfield.pas(101,21) Error: Identifier not found "Min"
newfield.pas(369) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[1]: *** [allideintf.ppu] Error 1
make[1]: Leaving directory `/root/lazarus/ideintf'
make: *** [ideintf] Error 2
Plz help. I am in the midst of something serious using lazarus. Dont
send me back to Delphi.
Fixed. Please update svn and compile again.
Mattias
_________________________________________________________________
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Bram Kuijvenhoven
2006-08-01 06:06:02 UTC
Permalink
Post by Alexandrov Alexandru
function min(i,j: integer): integer;
begin
Result := i;
if j<i then Result := j;
end;
- it is more likely the Math.Min function is optimized (e.g. asmed, inlined)
- it is most likely the IDE already uses the Math unit somewhere

My conclusion: use Math.Min here.

For other projects, adding a Min function might be desirable sometimes if you want to keep the executable size small, but be aware that the math unit is already included in quite some units. In that case, if you'd include your own Min/Max function in your code, you could even end up having two such functions in your executable if some other unit in your project uses Math.Min. Finally, there is still smartlinking!

Regards,

Bram
Micha Nelissen
2006-05-10 13:56:29 UTC
Permalink
Post by Bogusław Brandys
strip --strip-all project.exe
It's only reduce a half, the file size is still bigger than delphi.
It's 3+ MB
There was a bug in older versions so that not all debug sections were
removed. You should get 1 - 1.5MB stripped approx.

Micha
Continue reading on narkive:
Search results for 'Lazarus File bigger then Delphi File?' (Questions and Answers)
3
replies
How do you extract matches between two text files?
started 2010-02-12 10:31:27 UTC
programming & design
Loading...