User forums > Help
How to reduce the size of wxWidgets .exes produced by mingw?
takeshimiya:
--- Quote from: marty on August 08, 2006, 02:49:36 am ---Otherwise, I think I'll use C::B and mingw for development (since I can get that to work with wxWidgets and C::B has more features than VS6 such as the expandable brackets and wxSmith) and then load the same exact source files into the VS IDE when I'm ready to release the wxWidgets application (which will be the only time I care about the size).
--- End quote ---
Or a more comfortable approach: have an "GCC Debug" target, and a "VC Release" target, all inside in Code::Blocks.
--- Quote from: marty on August 08, 2006, 02:49:36 am ---I'm just curious, but does anyone know if the Linux versions of gcc and g++ produce large wxWidgets executables like their Windows counterparts?
--- End quote ---
In linux you'll have very small executable sizes thanks to this:
-Most distros already include stdlib++ as a shared library.
-Most distros already include wxWidgets as a shared library.
-Most distros already include wxWidgets dependencies (libpng, libjpeg, zlib, etc) as shared libraries.
On windows on the other side, when using linking to stdlib++ you always link statically, you can't link dinamycally to it
(unless you use another STL implementation).
As for the wxWidgets libraries and it's dependencies, you can link dinamycally to them, but obviously they don't come with Windows. :P
--- Quote from: marty on August 08, 2006, 03:08:25 am ---Takeshi, I noticed that in my "E:\wxWidgets-2.6.3" directory I have "wx-config.in". Does this mean I have to ./configure wxWidgets to produce "wx-config"?
--- End quote ---
Oh no, ignore that part :P It's just a program I've wrote myself that I'm wanting to get some time to integrate with C::B wizards.
--- Quote from: marty on August 08, 2006, 03:08:25 am ---Anyway, I copied this to my compiler command line:
/MD /DWIN32 /D__WXMSW__ /D_UNICODE /D_WINDOWS /GR /EHsc
and now the executable works! Thanks a million Takeshi.
--- End quote ---
:D
marty:
Cool, thanks for all of the information! I didn't know most of it.
I'm going to go with the "GCC Debug" and "VC Release" method, especially since I already have Unicode libraries of wxWidgets compiled for each.
After trial-and-error, I know for sure that the "/EHsc" compile switch made both the tutorial and sample output for C::B run correctly. (When it's removed the programs fail.) I am curious what it does. After looking at Google I think it has to do something with exception handling and I tried accessing cl.exe through the command line to get information but it wouldn't run because of a dll problem.
marty:
Hmmm... Shouldn't the content on
http://wiki.codeblocks.org/index.php?title=FAQ
--- Quote --- Q: Is it possible to use Visual C++ 6.0 with Code::Blocks?
A: MSVC++ 6 is not a C++ compiler. It was made before the C++ standard, so it compiles some language that isn't C++. Upgrade.
--- End quote ---
be changed to link to the page you showed me, Takeshi?
http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_C_6_with_Code::Blocks_IDE
Anyway, the wiki doesn't really answer the question.
takeshimiya:
--- Quote from: marty on August 08, 2006, 03:32:21 am ---After trial-and-error, I know for sure that the "/EHsc" compile switch made both the tutorial and sample output for C::B run correctly. (When it's removed the programs fail.) I am curious what it does. After looking at Google I think it has to do something with exception handling and I tried accessing cl.exe through the command line to get information but it wouldn't run because of a dll problem.
--- End quote ---
The "dll problem" you get there is likely to be the abscence of the dlls in your path.
That's why MS have included a vcsetvars32.bat (or something like) so you can use the compiler from command line without cluttering your path.
--- Quote from: marty on August 08, 2006, 03:49:43 am ---Hmmm... Shouldn't the content on
http://wiki.codeblocks.org/index.php?title=FAQ
--- Quote --- Q: Is it possible to use Visual C++ 6.0 with Code::Blocks?
A: MSVC++ 6 is not a C++ compiler. It was made before the C++ standard, so it compiles some language that isn't C++. Upgrade.
--- End quote ---
be changed to link to the page you showed me, Takeshi?
http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_C_6_with_Code::Blocks_IDE
Anyway, the wiki doesn't really answer the question.
--- End quote ---
Of course, it haves to be changed accordingly, it's a Wiki after all, so you're encouraged to edit it yourself. :)
marty:
Done. Thanks again for your help!
Navigation
[0] Message Index
[*] Previous page
Go to full version