Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Application fails spectacularly

I'm trying to link a Qt application with its libraries and the linker (MinGW) spews hundreds of lines like the following, and I am unsure how to proceed.

 cpp: undefined reference to `_Unwind_SjLj_Register'
 c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x29d):qcoreapplication_win.
 cpp: undefined reference to `_Unwind_SjLj_Unregister'
 c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x38c):qcoreapplication_win.
 cpp: undefined reference to `_Unwind_SjLj_Resume'
 c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x4ce):qcoreapplication_win.
 cpp: undefined reference to `_Unwind_SjLj_Register'
 c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x53e):qcoreapplication_win.
 cpp: undefined reference to `_Unwind_SjLj_Unregister'
 c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x635):qcoreapplication_win.
 cpp: undefined reference to `_Unwind_SjLj_Resume'
like image 747
user8923 Avatar asked Oct 13 '08 21:10

user8923


2 Answers

I don't know... but to me, spewing stuff about Unwind suggests that you have a mismatch between whether the library is compiled with exceptions and your application is compiled with exceptions.

If you want exceptions, make sure you have enabled them by adding the following line in your qmake file:

CONFIG += exceptions

or, if you do not want exceptions, use the opposite

CONFIG -= exceptions

And whatever you do, do not use C++ compiler options to set this yourself.

like image 145
Colin Jensen Avatar answered Nov 15 '22 08:11

Colin Jensen


It's been a while since I did any Qt development, but there were only a couple instances that I remember spewing out huge numbers of messages like this.

  • Include files for Qt were a different version than the shared libraries ... this happened when I upgraded and for some reason, you had to manually upgrade the include files.
  • The Qt libraries were missing altogether ... I vaguely remember the compiler working, but the linker failing when I first started.

I was doing Qt development targeted at an ARM processor, so I had extra oddities involved when cross-compiling.

like image 34
Steve Moyer Avatar answered Nov 15 '22 09:11

Steve Moyer