user8923
user8923

Reputation: 91

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'

Upvotes: 6

Views: 2311

Answers (3)

chacham15
chacham15

Reputation: 14251

2 possible reasons that i know of:

  1. if you try to link gcc4 libraries with a gcc3 linker.
  2. You need the -lstdc++ flag to the end of the compile command

Upvotes: 0

Colin Jensen
Colin Jensen

Reputation: 3809

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.

Upvotes: 6

Steve Moyer
Steve Moyer

Reputation: 5733

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.

Upvotes: 1

Related Questions