Boost logo

Boost Users :

Subject: [Boost-users] Compilation problems with MinGW
From: Benjamin Lau (blwy10v_at_[hidden])
Date: 2010-03-14 00:16:52


Hello everyone,

I successfully compiled Boost with MinGW (GCC 4.4.0 - it came
installed with the Qt SDK) with all the settings on, so it has
generated both dynamic and static libraries, debug and release
versions, multithreaded and non-multithreaded runtimes etc. I tried to
compile a small program that uses the serialization library
(http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/tutorial.html#simplecase)
and tried to link it statically with these libraries (in different
compilations):

libboost_serialization-mgw34-1_40.lib
libboost_serialization-mgw34-mt-1_40.lib
libboost_serialization-mgw34-mt-s-1_40.lib
libboost_serialization-mgw34-mt-s.lib
libboost_serialization-mgw34-mt.lib
libboost_serialization-mgw34-s-1_40.lib
libboost_serialization-mgw34-s.lib
libboost_serialization-mgw34.lib

Each time I compiled, it would always give me linker errors like so:

undefined reference to `__gxx_personality_sj0'
undefined reference to `_Unwind_SjLj_Register'
undefined reference to `_Unwind_SjLj_Unregister'
undefined reference to `_Unwind_SjLj_Resume'

These are repeated over and over again. The compiler command and flags
that I use are g++ test.cpp -o test -Ipath/to/boost/include
path/to/static/library

However, if I compile it with an import library like
boost_serialization-mgw34.lib I don't get such errors.

Searching online seems to suggest I am missing a compiler flag, but I
cannot determine which one I am missing. Perhaps my Google-Fu isn't
strong enough, so if I did miss out something patently obvious that
could have been found online I offer my due apologies.

Thanks a lot anyway!
Benjamin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net