Solving the _Unwind_Resume problem
BlitzMax Forums/Brucey's Modules/Solving the _Unwind_Resume problem
| ||
This error recently reared its ugly head again :C:/BlitzMax141/lib/libstdc++.a(functexcept.o):(.text$_ZSt24__throw_invalid_argumentPKc+0xb7): more undefined references to `_Unwind_Resume' follow Fortunately this time I was able to compare the build process of a wxWidgets sample with a sample in BlitzMax, to compare the two, and experiment with the BlitzMax build process in order to try to solve the problem once and for all. BlitzMax creates a temp file, in which sits a rather long list of all the .a files it wants to include in the executable. This file also includes some .o files from MinGW which reside in the lib dir. Then it calls ld.exe to put them all together. Interestingly, I noticed that the wxWidgets build does not use ld but instead has g++ doing all the work (which in turn calls ld as required). With some minor changes to my bmk, I made it also use g++, and not include those .o files, as well as not defining BlitzMax/lib as a valid lib path. This resulted in a valid exe build, without the _Unwind_Resume issue. Funnily enough, both Mac and Linux builds use g++ to do the final linking... Whether the Win32 side is doing it differently because of a not-so-friendly old version of GCC that once shipped with MinGW, I don't know... but making it work in a similar way to the other platforms has some obvious benefits : * ld.exe in BlitzMax/bin is no longer required * all the files in BlitzMax/lib are no longer required - by using g++, it knows where the libs are in relation to the MinGW installation. * various link order issues between different versions go away because g++ handles much of that for us. As yet I haven't found any negatives to using this process... But I'll try it against a 3.4.5 MinGW just in case it all goes horribly wrong there... |
| ||
I've updated my BMK to use g++ on Windows now.. this matches usage on all platforms for linking applications. It also works with MinGW 3.4.5... |
| ||
Interesting... Seems to work fine for me, so far. I wonder if it should replace the official bmk at some point, it really does add a lot of improvements over the original... |