Trying not to use dll to save a lot more space but failed...

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
untitled.txt
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Dec 23, 2008 1:38 pm

Trying not to use dll to save a lot more space but failed...

Post by untitled.txt »

I've just created a simple program using WxPack with CodeBlocks. First, I used the following WxWidgets Library setting:

- Use WxWidgets DLL
- wxWidgets is built as a monolithic library
- Enable unicode

The program can run fine, but when I try to bring this program to another computer, the problem is I have to brought mingwm10.dll and wxmsw28ud_gcc.dll along with the .exe as well. The size of the wxmsw28ud_gcc.dll (140 MB) is so huge that it does not make sense to distribute a tiny program along with it.

So I decided to go with an alternative choice which is turning the option "Use WxWidgets DLL" off. The problem is when I try to compile the program, I got this:

Code: Select all

C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u.a(monolib_appbase.o):appbase.cpp:(.text+0x19c)||undefined reference to `_Unwind_Resume'|
There are actually more than 50 errors and most of them complain about the same thing "undefined reference to `_Unwind_Resume'". Honestly I do not have any idea what does this mean at all.

How do I go from here?

Thank you in advance.
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

you are building with the debug option turned on. You need to build your application in RELEASE mode in order to reduce the size of the application and also which dll you distribute with it.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
morya
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Dec 14, 2007 2:29 am
Location: Xuzhou, China

Post by morya »

From the file name of wxmsw28ud_gcc.dll, I assume you use debug configuration to build your app, which will enlarge your app about one time.
And, if you have build your app with release config, you could still make use of upx like program to get your app smaller.

http://wiki.wxwidgets.org/WxWidgets_Bui ... igurations
&
http://wiki.wxwidgets.org/UPX
FYI
untitled.txt
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Dec 23, 2008 1:38 pm

Post by untitled.txt »

I have followed what you two have suggested. Thank you very much. The DLL for the release version is only 10 MB and the exe is only 90 kb. Very nice.

However, what if I want to use a non-DLL version? I have tried both compiling the same program with different setting:

Setting A: Unicode, Monolithic Library, No DLL
Setting B: Unicode, Not monolithic, No DLL

It seems that both settings do yield two common errors:

Code: Select all

C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_datacmn.o):datacmn.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
and

Code: Select all

C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_frame.o):frame.cpp:(.text+0x3db)||undefined reference to `_Unwind_Resume'|
However, I decided to post the whole error here:

Code: Select all

||=== QuickSnapperNoDLL, Debug ===|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_datacmn.o):datacmn.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_gdicmn.o)||In function `~wxResourceCache':|
..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_gdicmn.o)||In function `~wxGDIObjListBase':|
..\..\src\common\gdicmn.cpp|714|undefined reference to `_Unwind_Resume'|
..\..\src\common\gdicmn.cpp|714|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_gdicmn.o):..\..\src\common\gdicmn.cpp|804|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_gdicmn.o):gdicmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_validate.o):..\..\src\common\validate.cpp|29|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_validate.o):validate.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):..\..\src\common\event.cpp|67|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):..\..\src\common\event.cpp|66|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):..\..\src\common\event.cpp|65|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):..\..\src\common\event.cpp|62|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):..\..\src\common\event.cpp|74|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):..\..\src\common\event.cpp|92|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_event.o):event.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o)||In function `MSWDrawXPBackground':|
..\..\src\msw\button.cpp|818|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o):..\..\src\msw\button.cpp|838|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o):..\..\src\msw\button.cpp|879|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o):..\..\src\msw\button.cpp|885|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o):..\..\src\msw\button.cpp|476|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o):..\..\src\msw\button.cpp|301|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_button.o):button.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):..\..\src\msw\control.cpp|429|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):..\..\src\msw\control.cpp|422|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):..\..\src\msw\control.cpp|376|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):..\..\src\msw\control.cpp|388|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):..\..\src\msw\control.cpp|368|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):..\..\src\msw\control.cpp|311|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_control.o):control.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_ctrlcmn.o):..\..\src\common\ctrlcmn.cpp|145|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_ctrlcmn.o):..\..\src\common\ctrlcmn.cpp|146|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_ctrlcmn.o):ctrlcmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o):..\..\src\msw\window.cpp|6815|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o)||In function `wxGetTextMetrics':|
..\..\src\msw\window.cpp|6614|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o):..\..\src\msw\window.cpp|5602|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o):..\..\src\msw\window.cpp|4903|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o):..\..\src\msw\window.cpp|4798|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o):..\..\src\msw\window.cpp|4787|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_window.o):window.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colour.o):colour.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o):..\..\src\common\colourcmn.cpp|110|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o):..\..\src\common\colourcmn.cpp|72|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o):..\..\src\common\colourcmn.cpp|76|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o)||In function `ZlsR9wxVariantRK8wxColour':|
..\..\src\common\colourcmn.cpp|29|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o)||In function `~wxColourVariantData':|
..\..\src\common\colourcmn.cpp|29|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o):..\..\src\common\colourcmn.cpp|29|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_colourcmn.o):colourcmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_textctrl.o):..\..\src\msw\textctrl.cpp|2962|undefined reference to `_Unwind_Resume'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|
I am currently using WxPack. Doesn't the WxPack have all the settings built for any type of setting?

The DLL+Monolithic+Unicode version build is fine now, but for other versions, they still display the errors just like above. I do not know how to deal with those undefined references. What exactly are they? T_T

Any help is deeply appreciated.
Thank you in advance.
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Post by catalin »

Make sure you have all the wx libraries before the system libraries, in the linker list. ..And also that you have them in the right order.

e.g. The correct order for the following 11 wx libs (unicode, debug, non-monolithic):
"libwxmsw28ud_adv.a"
"libwxmsw28ud_html.a"
"libwxmsw28ud_core.a"
"libwxbase28ud_xml.a"
"libwxbase28ud.a"
"libwxtiffd.a"
"libwxjpegd.a"
"libwxpngd.a"
"libwxzlibd.a"
"libwxregexud.a"
"libwxexpatd.a"
untitled.txt
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Dec 23, 2008 1:38 pm

Post by untitled.txt »

I've done what you have said, but the same errors still occur... Those undefined references to Unwind Resume thing.

What I did is shown below. Is it correct? I have seen that most of the link libraries are already present so I only grabbed the libraries that are not in the list into the list.

By the way, the libwxmsw28ud_richtext.a is not in your list, catalin, so where should I really put it? Top of the list, bottom, or where, or remove it?

Thank you in advance.
Attachments
linker.GIF
linker.GIF (5.34 KiB) Viewed 3955 times
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Post by catalin »

libwxmsw28ud_richtext.a should be on the first position in that list, so.. before libwxmsw28ud_adv.a :)

Make sure that the selected policy is "Prepend target options to project options".

The list that I put here was only an example. It does not contain all the wx libraries, but the ones that are there are in the correct order. I can see there a strange character as a folder separator, and you don't need the path there for those libraries so better remove it - leave just the lib file name for all the libs.

In the list of libraries you must have the libraries that you use; any other ones are not a must. Example: if you do not use richtext in your code, it doesn't matter if you add the library and where you put it in the list since it will not be used. So if you do not use it you can also remove it.

In my build, the "system" libs ("project options") used are
"libkernel32.a"
"libuser32.a"
"libgdi32.a"
"libwinspool.a"
"libcomdlg32.a"
"libadvapi32.a"
"libshell32.a"
"libole32.a"
"liboleaut32.a"
"libuuid.a"
"libcomctl32.a"
"libwsock32.a"
"libodbc32.a"
p.s. The "Linker libraries" list that you are modifying is the one for the Debug build target, and you are building for the same Debug build target, right?
untitled.txt
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Dec 23, 2008 1:38 pm

Post by untitled.txt »

In the list of libraries you must have the libraries that you use
Is there a way to know which library am I needed? Honestly, I only knew about getting .h files to be in source codes, but for .a libraries, I do not know how to deal with them correctly.
In my build, the "system" libs ("project options") used are
All of those libs are in my project as well.
p.s. The "Linker libraries" list that you are modifying is the one for the Debug build target, and you are building for the same Debug build target, right?
Yes.

By the way, I still have the same errors. These monsters just don't go anywhere. T_T

Here is a slight part of those errors:

Code: Select all

C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_datacmn.o):datacmn.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_gdicmn.o)||In function `~wxResourceCache':|
..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
..\..\src\common\gdicmn.cpp|871|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud_core.a(corelib_gdicmn.o)||In function `~wxGDIObjListBase':|
..\..\src\common\gdicmn.cpp|714|undefined reference to `_Unwind_Resume'|
...
I think I need to know some sort of technical stuff behind this first in order to proceed. If possible, could you give me some keywords so that I could google about this?

Thank you very much.
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Post by catalin »

untitled.txt wrote:Is there a way to know which library am I needed?
Not that I know of.

I made my list(s) by checking the samples in wxW - the libraries used for each one are in "the correct" order, and many times one or two libs differ from one sample to another. In a fairly short time you can make a list with most (all?) the libs.. Any other "outside" library addition was on try/fail basis - with "the right spot" being from the first position in the list, to the last one. But you will improve your guessing skills after a while :wink:
Now identifying which library(-ies) I needed for a specific functionality was also based on the samples, or at most Google...

untitled.txt wrote:These monsters just don't go anywhere.
IMO we eliminated the wxW and C::B from the equation (I figured you use Code::Blocks by the looks of that Linker libs pic; I also got at least one of those errors having some libs in the wrong order but it should no longer be the case here).
The only remaining possibility, as I see it, would be the compiler.

I reviewed your posts and you have this mentioned in the first one:
untitled.txt wrote:when I try to bring this program to another computer, the problem is I have to brought mingwm10.dll
If you are using another computer, is there any chance of having different gcc versions on the two of them? Better yet - try to get C::B with mingw [re]installed on the second computer, make the needed changes in the project and only then build again. Worst case would be to also need to rebuild wxW but it will still be fast compared to the 5 days already passed since you opened this topic :wink: C::B with mingw
untitled.txt
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Dec 23, 2008 1:38 pm

Post by untitled.txt »

I've reinstalled Code::Blocks with mingw setting as you have suggested, yet the same problem persisted. Therefore, I will go for rebuilding wxWidgets.

One of the reasons that I use wxPack is because I cannot use mingw32-make to make the library. I got the following error:

Code: Select all

D:\wxMSW-2.8.9\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=0 UNICODE=1
if not exist gcc_mswu mkdir gcc_mswu
process_begin: CreateProcess(NULL, -c "if not exist gcc_mswu mkdir gcc_mswu", ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: [gcc_mswu] Error 2 (ignored)
if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib
process_begin: CreateProcess(NULL, -c "if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib", ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [..\..\lib\gcc_lib] Error 2
I have also tried using the configure instead. It does its jobs yet when I tried to set the path of the library into the Environment variables, code::blocks seem to have some issues with the library.

But for now, let's try to mingw32-make. I wonder what are the errors all about. I was just following http://wiki.codeblocks.org/index.php?ti ... wsQuickRef

Any suggestion for the errors in the code tag above?

Thank you in advance.
Post Reply