User forums > Help
How to reduce the size of wxWidgets .exes produced by mingw?
marty:
In the meantime I compiled the Unicode library version of wxWidgets with VSC++6 and created a new project in C::B which uses it and I get the same error, (except this time the library name includes a "u" for Unicode.)
--- Code: ---wxbase26u.lib(ipcbase.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
wxbase26u.lib(regconf.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
wxbase26u.lib(dir.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
wxbase26u.lib(dde.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
...
--- End code ---
takeshimiya:
Just in case, the commandline I give to the MSVC compiler when I compile a simple wxWidgets program (Release, Unicode) is:
Compiler: wx-config --cflags --prefix=D:\Develop\src\wxWidgets-2.6.3vc
--- Code: ---/MD /DWIN32 /D__WXMSW__ /D_UNICODE /ID:\Develop\src\wxWidgets-2.6.3vc\lib\vc_lib\mswu
/ID:\Develop\src\wxWidgets-2.6.3vc\include /I. /D_WINDOWS /GR /EHsc
--- End code ---
Linker: wx-config --libs --prefix=D:\Develop\src\wxWidgets-2.6.3vc
--- Code: ---/LIBPATH:D:\Develop\src\wxWidgets-2.6.3vc\lib\vc_lib wxmsw26u_xrc.lib wxmsw26u_html.lib wxmsw26u_adv.lib
wxmsw26u_core.lib wxbase26u_xml.lib wxbase26u_net.lib wxbase26u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib
wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib
comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib
--- End code ---
marty:
After changing the link arguments from
/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBC
to
/NODEFAULTLIB:LIBC
the application compiled with no errors. However, when I ran the default application produced by C::B, no frame showed up and a runtime error occurred. I changed the source code to the "Hello world" tutorial on wxWidget's website (which I can get to compile and run correctly in the VS IDE) and this time there was no runtime error, but an infinite loop seemed to be running and no frame showed up. I am very confused. Does anyone have any tips with my problem?
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).
I'm just curious, but does anyone know if the Linux versions of gcc and g++ produce large wxWidgets executables like their Windows counterparts?
Thanks.
sethjackson:
--- Quote from: marty on August 08, 2006, 02:49:36 am ---After changing the link arguments from
/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBC
to
/NODEFAULTLIB:LIBC
the application compiled with no errors. However, when I ran the default application produced by C::B, no frame showed up and a runtime error occurred. I changed the source code to the "Hello world" tutorial on wxWidget's website (which I can get to compile and run correctly in the VS IDE) and this time there was no runtime error, but an infinite loop seemed to be running and no frame showed up. I am very confused. Does anyone have any tips with my problem?
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).
I'm just curious, but does anyone know if the Linux versions of gcc and g++ produce large wxWidgets executables like their Windows counterparts?
Thanks.
--- End quote ---
On my OpenBSD box the C++ (not wxWidgets) hello world is half the size of the Windows version with the same version of GCC.
I have tried compiling wx so I really don't know......
marty:
--- Quote from: Takeshi Miya on August 08, 2006, 02:43:21 am ---Just in case, the commandline I give to the MSVC compiler when I compile a simple wxWidgets program (Release, Unicode) is:
Compiler: wx-config --cflags --prefix=D:\Develop\src\wxWidgets-2.6.3vc
--- Code: ---/MD /DWIN32 /D__WXMSW__ /D_UNICODE /ID:\Develop\src\wxWidgets-2.6.3vc\lib\vc_lib\mswu
/ID:\Develop\src\wxWidgets-2.6.3vc\include /I. /D_WINDOWS /GR /EHsc
--- End code ---
Linker: wx-config --libs --prefix=D:\Develop\src\wxWidgets-2.6.3vc
--- Code: ---/LIBPATH:D:\Develop\src\wxWidgets-2.6.3vc\lib\vc_lib wxmsw26u_xrc.lib wxmsw26u_html.lib wxmsw26u_adv.lib
wxmsw26u_core.lib wxbase26u_xml.lib wxbase26u_net.lib wxbase26u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib
wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib
comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib
--- End code ---
--- End quote ---
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"?
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.
--- Quote from: sethjackson on August 08, 2006, 02:53:01 am ---On my OpenBSD box the C++ (not wxWidgets) hello world is half the size of the Windows version with the same version of GCC.
I have tried compiling wx so I really don't know......
--- End quote ---
Ok, so non-Windows GCC is more likely better in outputted program's size than the Windows GCC for non-wxWidgets. Thank you.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version