PDA

View Full Version : Linker error after clean install



winder
1st February 2010, 22:17
Hello all.

I just installed the latest version of qt sdk, along with the qt creator ide. I start by creating an empty qt gui application, from the templates. When i try to build, i get the following output:


Running build steps for project dok...
Starting: c:/qt/2010.01/qt/bin/qmake.exe H:/Projects/Qt Creator/dok/dok.pro -spec win32-g++ -r
Exited with code 0.
Starting: C:/MinGW/bin/mingw32-make.exe -w
C:\MinGW\bin\mingw32-make.exe: Entering directory `H:/Projects/Qt Creator/dok'
C:/MinGW/bin/mingw32-make.exe -f Makefile.Debug
mingw32-make.exe[1]: Entering directory `H:/Projects/Qt Creator/dok'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\dok.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -L"c:\Qt\2010.01\qt\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
mingw32-make.exe[1]: Leaving directory `H:/Projects/Qt Creator/dok'
C:\MinGW\bin\mingw32-make.exe: Leaving directory `H:/Projects/Qt Creator/dok'
c:\Qt\2010.01\qt\lib/libqtmaind.a(qtmain_win.o)(.text+0x64):../../include/QtCore/../../src/corelib/tools/qvector.h:410: undefined reference to `_Unwind_Resume'
c:\Qt\2010.01\qt\lib/libqtmaind.a(qtmain_win.o)(.text+0x12a):C:\qt-greenhouse\Trolltech\Code_less_create_more\Trollte ch\Code_less_create_more\Troll\4.6\qt\src\winmain/qtmain_win.cpp:135: undefined reference to `_Unwind_Resume'
c:\Qt\2010.01\qt\lib/libqtmaind.a(qtmain_win.o)(.text$_ZN7QVectorIPcE7r eallocEii[QVector<char*>::realloc(int, int)]+0x1a1):../../include/QtCore/../../src/corelib/tools/qvector.h:482: undefined reference to `_Unwind_Resume'
c:\Qt\2010.01\qt\lib/libqtmaind.a(qtmain_win.o)(.text$_ZN7QVectorIPcE7r eallocEii[QVector<char*>::realloc(int, int)]+0x1dc):../../include/QtCore/../../src/corelib/tools/qvector.h:483: undefined reference to `_Unwind_Resume'
c:\Qt\2010.01\qt\lib/libqtmaind.a(qtmain_win.o)(.eh_frame+0x12): In function `Z4qMinIiERKT_S2_S2_':
../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:95: undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [debug\dok.exe] Error 1
C:\MinGW\bin\mingw32-make.exe: *** [debug] Error 2
Exited with code 2.
Error while building project dok
When executing build step 'Make'

any ideas please? I think i have everything correctly set up.

My OS is windows 7.

thanks in advance

tksharpless
14th April 2010, 17:09
I have exactly the same problem with qt-sdk-win-opensource-2010.02.1 on winVista 32bit. But only with certain projects, others link cleanly. Neither rebuilding qtmain_win.a nor a full reinstall of Qt+mingw changes the situation.

This is a significant bug, somebody at Qt please review!

I will let you all know if I find a workaround.

-- Tom

squidge
14th April 2010, 21:52
To me, that smells of libstdc++ not being linked with your code.

Can you upload the project somewhere?

tksharpless
15th April 2010, 15:33
The problem is apparently due to the fact that Qt compiles the 4.6 libraries with gcc 4.4 but still ships the Windows opensource sdk with gcc 3.5. It can be fixed by upgrading MinGW to gcc 4.4, which is easy enough to do; but don't you think Qt should do that and ship a working sdk?

I do, and have reported this as a packaging bug on the Qt tracker.

-- Tom

squidge
15th April 2010, 20:05
The SDK works out of the box and ships with GCC 4.4.

Maybe you also have GCC 3.5 somewhere and QtCreator is using that because it has a higher priority in your path?

tksharpless
16th April 2010, 02:28
You are right. I do have another MinGW installation, and it was gcc 3.5 until I upgraded it recently. I just reinstalled the MinGW from qt-sdk-win-opensource-2010.02.1.exe and have verified that it is indeed gcc 4.4. So I must have been running the other compiler. Sorry for the fuss.

-- Tom