PDA

View Full Version : Link errors: undefined reference to `_Unwind_Resume' and '__gxx_personality_v0'



jonks
17th August 2010, 14:59
I created a default Gui project (mo modifications whatsoever) and, using Creator, confirmed that it compiled and linked. (Dynamic linkage to QT libs).

I then opened a cmd prompt. Set my environmental variables to the various Qt bin dirs, then ran qmake and mingw. I get an odd linker error.

I've checked other posts with this problem and in their cases it turned out to me a mingw version problem. In my case I only have the mingw that was installed by QT Creator.

The error is below.
Do you have any idea why the cmd line compile fails in my case?



C:\test\test>mingw32-make.exe -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32


C:\test\test>gcc -v
Using built-in specs.
Target: i686-w64-mingw32
Configured with: ../gcc44-svn/configure --target=i686-w64-mingw32 --host=i686-w64-mingw32 --disable-multilib --disable-nls --disable-win32-registry --prefix=/mi
ngw32 --with-gmp=/mingw32 --with-mpfr=/mingw32 --enable-languages=c,c++
Thread model: win32
gcc version 4.4.3 (GCC)


C:\test\test>qmake.exe test.pro -r -spec win32-g++ CONFIG+=release


C:\test\test>mingw32-make.exe -w
mingw32-make.exe: Entering directory `C:/test/test'
mingw32-make.exe -f Makefile.Release
mingw32-make.exe[1]: Entering directory `C:/test/test'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\test.exe release/main.
o release/mainwindow.o release/moc_mainwindow.o -L"c:\Qt\2010.04\qt\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
c:\Qt\2010.04\qt\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 1c2): undefined reference to `_Unwind_Resume'
c:\Qt\2010.04\qt\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text$_Z N7QVectorIPcE7reallocEii[QVector<char*>::realloc(int, int)]+0x187): undefined reference t
o `_Unwind_Resume'
c:\Qt\2010.04\qt\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.eh_fram e+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [release\test.exe] Error 1
mingw32-make.exe[1]: Leaving directory `C:/test/test'
mingw32-make.exe: *** [release] Error 2
mingw32-make.exe: Leaving directory `C:/test/test'


My QT related path variables are:

C:\Qt\2010.04\mingw\bin\
C:\Qt\2010.04\qt\mkspecs\
C:\Qt\2010.04\qt\bin\

jonks
18th August 2010, 13:29
Running C:\Qt\2010.04\bin\qtenv.bat fixes the problem.

sheto
18th December 2010, 08:07
It works for me. thx.

minirop
18th December 2010, 14:55
just to explain the problem. is that you need to compile Qt app with the same compiler that compiled Qt itself (like the one's inside the SDK). You can also recompile Qt with yours.
some GCC are usign SJLJ and some DW2.