Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 592909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:47:21+00:00 2026-05-13T15:47:21+00:00

I have a static library that I have built with MinGW, I am trying

  • 0

I have a static library that I have built with MinGW, I am trying to link to that library from a Qt application. I keep getting linker errors caused by one of the object files in the library. This file actually declares a couple of Boost headers, one for use of shared_ptr and the other so I can make a class noncopyable. I believe using this boost functionality is what is causing the issue but I have no idea why. If I comment out the classes in the Qt app that use the class defined in the file, the Qt app links fine. This is the error part of the output:

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x10a):
undefined reference to
`__gxx_personality_sj0′

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x12f):
undefined reference to
`_Unwind_SjLj_Register’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x203):
undefined reference to
`_Unwind_SjLj_Resume’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x20e):
undefined reference to
`_Unwind_SjLj_Unregister’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x226):
undefined reference to
`__gxx_personality_sj0′

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x24b):
undefined reference to
`_Unwind_SjLj_Register’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x31f):
undefined reference to
`_Unwind_SjLj_Resume’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text+0x32a):
undefined reference to
`_Unwind_SjLj_Unregister’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text$_ZN5boost6detail12shared_countC1IN3foo25foo_SomeClassImplEEEPT_[boost::detail::shared_count::shared_count(foo::foo_SomeClassImpl*)]+0xc):
undefined reference to
`__gxx_personality_sj0′

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text$_ZN5boost6detail12shared_countC1IN3foo25foo_SomeClassImplEEEPT_[boost::detail::shared_count::shared_count(foo::foo_SomeClassImpl*)]+0x31):
undefined reference to
`_Unwind_SjLj_Register’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text$_ZN5boost6detail12shared_countC1IN3foo25foo_SomeClassImplEEEPT_[boost::detail::shared_count::shared_count(foo::foo_SomeClassImpl*)]+0xfb):
undefined reference to
`_Unwind_SjLj_Resume’

C:\blah\build\windows\mingw\libfoo.a(foo_ctis.cpp.obj):foo_ctis.cpp:(.text$_ZN5boost6detail12shared_countC1IN3foo25foo_SomeClassImplEEEPT_[boost::detail::shared_count::shared_count(foo::foo_SomeClassImpl*)]+0x106):
undefined reference to
`_Unwind_SjLj_Unregister’ collect2: ld
returned 1 exit status

One other thing to mention is that I am using a pointer to implementation in this class.
Any help would be much appreciated.

Solved:
I figured out that I had an older version of GCC in my path that was beng included before my MinGW supplied GCC version. The old version was included in a GNUStep package that I had from awhile back. I think that configuration of these different versions was causing problems. Thanks to kemiisto, who was on the right track in solving the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:47:22+00:00Added an answer on May 13, 2026 at 3:47 pm

    It seems that your static library was linked against one MinGW distribution (i.e. 3rd version) but you try to link your application with this library using other MinGW distribution (i.e. 4th version which is distributed with binary Qt). You should rebuild your library using the same MinGW which you use for your application development.

    Update

    May be it’s another well known problem. Take a look at this topic. You probably have 2 different folders with Qt libs

    C:\Qt\2009.05\bin;C:\Qt\2009.05\qt\bin 
    

    in your path too. Libraries in the first folder (…\bin) compiled with VS2008 and libraries in the second one (…\qt\bin) compiled with MinGW. The items in path variable are looked up when your application starts. Suddenly the folder with “wrong” libraries exists before the folder with correct item in your path variable. What you can do is to copy QtCore4.dll, QtGui4.dll and other libraries that you need to folder with your application executable. Hope this helps.

    Some links about this problem:

    • @qtforum.org
    • @some blog post (in Russian =))
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shared library project that is built from 4 static libraries (
I have a static library project that I inherited from another developer. I added
I have a static library built with 3.1.3. I'm including it into an application,
gcc 4.5.1 Fedora 14 Linux I have this static library that was build from
I have a static library (let's call it S) that uses a category (NSData+Base64
I have a Visual Studio 2008 C++ project that outputs a static library and
I have created a static library following this link . But I am facing
I have built a static library in my home directory and there is also
I have a project that has a dependency on a static library. In Xcode
Say I have two static libraries that were not built by me and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.