Krzysztof Tomaszewski, Poland
p.s.
Please, help me - I don't want to use Borland libraries (OWL, VCL, who knows
what more...) no more!!! ;-)
> Hi, I'm new with wxWindows. Earlier I was using OWL 5.0 (with Borland C++
> 5.00 compiler) and my EXE-files had size about 100KB. My largest executable
> file compiled from program with OWL was about 350KB. Now I want to start
> using wxWindows instead of OWL, but EXE-file produced from "minimal" example
> project is about 1.2MB (release version).
Not having used OWL, Imay be offbase, but I believe there are DLLs you must
distribute with your app as well if you distribute it. You could compile
wxWindows as a DLL and that would drastically shrink the size of the EXE itself.
g
Regards,
Monty Manley
> -----Original Message-----
> From: K.Tomaszewski [mailto:atomo...@o2.pl]
> Sent: Wednesday, January 02, 2002 9:57 AM
> To: wx-u...@lists.wxwindows.org
> Subject: [wxMSW]: why EXE-files are so large?
>
>
> Hi, I'm new with wxWindows. Earlier I was using OWL 5.0 (with
> Borland C++
> 5.00 compiler) and my EXE-files had size about 100KB. My
> largest executable
> file compiled from program with OWL was about 350KB. Now I
> want to start
> using wxWindows instead of OWL, but EXE-file produced from
> "minimal" example
> project is about 1.2MB (release version).
> I'm using Borland C++ 5.5 compiler from C++ Builder 5 (even
> VCL minimal
> aplication has size less then 400KB).
> I'd like to stay with wxWindows, but size of programs
> compiled with it is
> quite big disadvantage for me. Is there someone who know, how
> to compile
> smaller executables?
> I've compiled wxWindows, and my wxWindows main LIB-file is about 5MB
> (release).
>
> Krzysztof Tomaszewski, Poland
>
> p.s.
> Please, help me - I don't want to use Borland libraries (OWL,
> VCL, who knows
> what more...) no more!!! ;-)
>
>
> _______________________________________________
> wx-users mailing list
> wx-u...@lists.wxwindows.org
> http://lists.wxwindows.org/mailman/listinfo/wx-users
>
VC++ is probably the bester optimizing compiler and can generate relatively small binaries.
You can also switch features off in include/wx/msw/setup0.h, which may help reduce size.
And finally you can cheat and use upx.exe which will reduce the exe size by maybe 50%. My local copy of Tex2RTF is statically linked with VC++ and upx'ed, ending up at a meagre 268,288 bytes.
Regards,
Julian
At 05:23 PM 1/2/02 +0100, you wrote:
>Hi, thanks for answer.
>But, you see, I'd like to generaly decrease the size of EXE-file. When I'll
>do as you said I will have to distibute 2 files: EXE-file and DLL-file (when
>we're talking about Win platform, but I hope that with wxWindows I'll be
>able to compile my single code for Unix, Linux, etc - there is no DLL's),
>and I think (nearly sure) that their size (both) will be even larger than
>size of standalone EXE-file.
>
>Krzysiek
>
>>
>> Not having used OWL, Imay be offbase, but I believe there are DLLs you
>must
>> distribute with your app as well if you distribute it. You could compile
>> wxWindows as a DLL and that would drastically shrink the size of the EXE
>itself.
>>
>> g
>
>
>
>_______________________________________________
>wx-users mailing list
>wx-u...@lists.wxwindows.org
>http://lists.wxwindows.org/mailman/listinfo/wx-users
--
Red Hat UK Ltd, Unit 200 Rustat House, 62 Clifton Road, Cambridge, UK. CB1 7EG Tel: +44 (1223) 271063
Krzysiek
>
Krzysiek
For example, rather than doing this at the head of every .cpp file:
#include <wx/wx.h>
Try this:
#include <wx/wxwindow.h>
#include <wx/wxbutton.h>
... and so on. In this way you can use only the items you need and not link
in unnecessary objects. You'll still have a pretty big EXE no matter what,
though: I modified the MINIMAL project to try this out and my EXE still came
to over 800K on Windows using the Borland compiler. (I probably could have
trimmed some stuff, though.) If you think about it, 800K isn't that
unreasonable for the amount of stuff there.
Regards,
Monty
> -----Original Message-----
> From: K.Tomaszewski [mailto:atomo...@o2.pl]
> And finally you can cheat and use upx.exe which will reduce the exe size by maybe 50%. My local copy of Tex2RTF is statically linked with VC++ and upx'ed, ending up at a meagre 268,288 bytes.
UPX makes many Borland compiled programs crash on startup (first hand experience speaking here). I have tried the latest UPX and all various settings for what to compress and what not to
compress. The key to the problem is probably (hopefully) there, but I never found it. I haven't tried it on wxWindows RELEASE build samples though....
The best compression I have gotten on our Borland compiled EXEs was about 29%.
g
It's free, open-source, blah blah...the long and the short of it is, the
1.0mb bombs.exe (wxwin\demos\bombs) is compressed to 400k. Not bad as
far as I'm concerned.
-----Original Message-----
From: wx-user...@lists.wxwindows.org
[mailto:wx-user...@lists.wxwindows.org] On Behalf Of George Tasker
Sent: Wednesday, January 02, 2002 11:14 AM
To: wx-u...@lists.wxwindows.org
Subject: Re: [wxMSW]: why EXE-files are so large?
"K.Tomaszewski" wrote:
g
Manley, Monty R. wrote:
> For example, rather than doing this at the head of every .cpp file:
>
> #include <wx/wx.h>
>
> Try this:
>
> #include <wx/wxwindow.h>
> #include <wx/wxbutton.h>
Are you sure this actually helps? If yes, then Borland C++ is
*really* weird compiler. I can't believe this...
Instead, you can disable features you don't want in setup.h -- just
set wxUSE_xxx defines to 0 for unused stuff. That's about the only
way how to reduce static binary's size.
HTH,
Vaclav