views:

1252

answers:

2

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'
A: 

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.

Steve Moyer
+5  A: 

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.

Colin Jensen