Spring link error

Spring link error

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Spring link error

Post by LeroyLinux »

I have a windows xp machine at home, and I followed the instructions for mingw compiling with CMake. I downloaded the tdm-mingw-1.908.0-4.4.1-2.exe version of Mingw, and did a fresh installation of mingw on my system. I used CMake and got the mingwlibs_v20.2.7z and latest spring source from github.com/spring/spring/downloads.

I started CMake and did a MinGW configure, then from a Mingw console in the TotalATDM (the directory cmake creates I forget its exact name) I did mingw32-make.

Everything builds until the link, when it explodes with gxx-0-personality and unwind-resume undefined lines (about 20 of them) and dies.

What am I doing wrong?

Thanks
:-)
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring link error

Post by zerver »

Sound like you are using a bad combination of sjlj and dwarf2 libs. Try to download the dwarf2 variety of everything.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring link error

Post by hoijui »

why did you choose TDM?
the default is the normal MinGW, which i recommend.
That is what the instructions on the Wiki are about:
http://springrts.com/wiki/Building_Spri ... mmended.29
(i recommend getting 4.4, even though there is some 4.5 stuff already)

i just updated this wiki page (the mingwlibs reference)
be sure to get the version for GCC 4.4, if you will be using the official MinGW now.

i would bet on the mingwlibs for TDM to be outdated anyway (eg OpenAL).
LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Re: Spring link error

Post by LeroyLinux »

After instaling the "official" mingw with gcc 4 and following the instructions, and a long linking of the spring.exe, I get

C:\spring\mingwlibs\lib\libboost_program_options-mt.a(convert.o):convert.cpp:(.t
ext$_ZN5boost6detail7convertIwcNS_3_bi6bind_tINSt12codecvt_base6resultENS_4_mfi4
cmf7IS5_St23__codecvt_abstract_baseIwciERiPKcSC_RSC_PwSE_RSE_EENS2_5list8INS2_5v
alueIPKSt7codecvtIwciEEENS_3argILi1EEENSO_ILi2EEENSO_ILi3EEENSO_ILi4EEENSO_ILi5E
EENSO_ILi6EEENSO_ILi7EEEEEEEEESbIT_St11char_traitsISY_ESaISY_EERKSbIT0_SZ_IS13_E
SaIS13_EET1_[std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocato
r<wchar_t> > boost::detail::convert<wchar_t, char, boost::_bi::bind_t<std::codec
vt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abs
tract_base<wchar_t, char, int>, int&, char const*, char const*, char const*&, wc
har_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<w
char_t, char, int> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::
arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > > >(std::basic_string<char
, std::char_traits<char>, std::allocator<char> > const&, boost::_bi::bind_t<std:
:codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codec
vt_abstract_base<wchar_t, char, int>, int&, char const*, char const*, char const
*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::cod
ecvt<wchar_t, char, int> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, b
oost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > >)]+0x463): undefine
d reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(convert.o):convert.cpp:(.e
h_frame+0x12): undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.t
ext+0xf5): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.t
ext+0x141): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.t
ext+0x1f4): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.t
ext+0x2b1): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.t
ext+0x335): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.t
ext+0x406): more undefined references to `_Unwind_Resume' follow
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(cmdline.o):cmdline.cpp:(.e
h_frame+0x12): undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(positional_options.o):posi
tional_options.cpp:(.text+0x1af): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(positional_options.o):posi
tional_options.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v
0'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(utf8_codecvt_facet.o):utf8
_codecvt_facet.cpp:(.text$_ZN5boost15program_options6detail18utf8_codecvt_facetD
1Ev[boost::program_options::detail::utf8_codecvt_facet::~utf8_codecvt_facet()]+0
x11): undefined reference to `std::codecvt<wchar_t, char, int>::~codecvt()'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(utf8_codecvt_facet.o):utf8
_codecvt_facet.cpp:(.text$_ZN5boost15program_options6detail18utf8_codecvt_facetD
0Ev[boost::program_options::detail::utf8_codecvt_facet::~utf8_codecvt_facet()]+0
x14): undefined reference to `std::codecvt<wchar_t, char, int>::~codecvt()'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(utf8_codecvt_facet.o):utf8
_codecvt_facet.cpp:(.rdata$_ZTVN5boost15program_options6detail18utf8_codecvt_fac
etE[vtable for boost::program_options::detail::utf8_codecvt_facet]+0x24): undefi
ned reference to `std::codecvt<wchar_t, char, int>::do_length(int&, char const*,
char const*, unsigned int) const'
C:\spring\mingwlibs\lib\libboost_program_options-mt.a(utf8_codecvt_facet.o):utf8
_codecvt_facet.cpp:(.eh_frame+0x11): undefined reference to `__gxx_personality_v
0'
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.text
+0x1c4): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.text
+0x1cc): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.text
+0x42f): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.text
+0x445): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.text
+0x4d1): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.text
+0x535): more undefined references to `_Unwind_Resume' follow
C:\spring\mingwlibs\lib\libboost_system-mt.a(error_code.o):error_code.cpp:(.eh_f
rame+0x12): undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(slot.o):slot.cpp:(.text+0x146): un
defined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(slot.o):slot.cpp:(.eh_frame+0x12):
undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.t
ext+0xd4): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.t
ext+0x30c): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.t
ext+0x364): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.t
ext+0x3b8): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.t
ext+0x430): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.t
ext+0x438): more undefined references to `_Unwind_Resume' follow
C:\spring\mingwlibs\lib\libboost_signals-mt.a(signal_base.o):signal_base.cpp:(.e
h_frame+0x12): undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):connection.cpp:(.tex
t+0x2ed): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):connection.cpp:(.tex
t+0x3a4): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):connection.cpp:(.tex
t+0x40e): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):connection.cpp:(.tex
t+0x47a): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):connection.cpp:(.tex
t+0x4b7): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):cCreating library fi
le: libspring.dll.a
onnection.cpp:(.text+0x4f3): more undefined references to `_Unwind_Resume' follo
w
C:\spring\mingwlibs\lib\libboost_signals-mt.a(connection.o):connection.cpp:(.eh_
frame+0x12): undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.text+0xdf): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.text+0x252): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.text+0x371): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.text+0x62d): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.text+0x664): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.text+0x67b): more undefined references to `_Unwind_Resume' follow
C:\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o):named_slot_map.c
pp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.text+
0x3f): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.text+
0x83): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.text+
0xdb): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.text+
0x167): undefined reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.text$
_ZNSt4listIN5boost7signals10connectionESaIS2_EE8_M_eraseESt14_List_iteratorIS2_E
[std::list<boost::signals::connection, std::allocator<boost::signals::connection
> >::_M_erase(std::_List_iterator<boost::signals::connection>)]+0x2e): undefined
reference to `_Unwind_Resume'
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.text$
_ZNSt4listIN5boost7signals10connectionESaIS2_EE14_M_create_nodeERKS2_[std::list<
boost::signals::connection, std::allocator<boost::signals::connection> >::_M_cre
ate_node(boost::signals::connection const&)]+0x55): more undefined references to
`_Unwind_Resume' follow
C:\spring\mingwlibs\lib\libboost_signals-mt.a(trackable.o):trackable.cpp:(.eh_fr
ame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
mingw32-make[4]: *** [spring.exe] Error 1
:cry:
LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Re: Spring link error

Post by LeroyLinux »

I want to start participating, but would like to get it to build...
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring link error

Post by hoijui »

please use pastebin(.com) for such things.

if you go to your mingwlibs/README.markdown file,
does if contain the following text?
"cross-compiled by hoijui with MinGW 4.4.2 on 21. April 2010"
if yes, try using the master branch instead, if not, you still got the wrong mingwlibs branch.
LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Re: Spring link error

Post by LeroyLinux »

After getting all the latest of everything, including the git source code, and reading the instructions, the build shows over and over:

Code: Select all

C:\msys\1.0\home\Jason\spring\mingwlibs\lib\libboost_signals-mt.a(named_slot_map.o): In function `pair':
/usr/lib/gcc/i686-mingw32/4.4.2/include/g++-v4/bits/stl_pair.h:68: undefined reference to `__gxx_personality_sj0'
/usr/lib/gcc/i686-mingw32/4.4.2/include/g++-v4/bits/stl_pair.h:68: undefined reference to `_Unwind_SjLj_Register'
I'm sorry if I'm being a bother about this and for the long code I posted earlier; my apologies.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring link error

Post by hoijui »

please answer the question i asked in my last post.

it seems to want SjLj symbols still, which i guess suggests, that you do not have a clean official MinGW 4.4 installed (no guarantee for that though).
Btw, the Wiki instructions should make clear what to get from MinGW, and they specifically recommend not to get latest of everything. Maybe that is the problem?
Gahzi
Posts: 3
Joined: 25 May 2010, 22:00

Re: Spring link error

Post by Gahzi »

I just got it to build for me and I did it for my first time today.

Originally I had a been using TDM-mingw and was getting some errors, but I got it to build after switching to mingw + GCC4.4.0 (which is what it says to have in the wiki). Just make sure that your TDM is full uninstalled and reconfigure with cmake.

@hoijui: I noticed in the mingwlibs readme that I couldn't find "cross-compiled by hoijui with MinGW 4.4.2 on 21. April 2010". I don't see how I could be using an older version as I cloned the repo from git today. I think you forgot to push the readme in your latest commit. I may be wrong though :)

After getting spring to build properly, I double clicked on the .exe and recieved a missing devIl.dll error. Any ideas whats wrong?

Thanks a bunch!
LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Re: Spring link error

Post by LeroyLinux »

I'd recommend one download of the minimum mingw setup, with gdb and auxillary ide, etc, for "newbies" to build and run, with a standard path setup and git, etc.

I followed all the instructions in the wiki, with the "official" mingw, "official" gcc and mingwlibs for gcc4 as a subdir of the spring directory. CMake was done exactly as in the instructions, and I did a mingw32-make. I felt so good as everything compiled and was linking spring.exe.

The twenty minutes later it exploded with not-found errors. Maybe something to do with this dwarf stuff or whatever. If versions are incorrect something should tell me before the twenty minute link-explosion.

:(
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring link error

Post by hoijui »

Leroy, did you checkout the right mingwlibs branch as described in the wiki?

Gahzi, no, i did not forget to upload it, prove is here:
http://github.com/spring/mingwlibs/blob ... E.markdown
search for "cross-compiled by hoijui with MinGW 4.4.2 on 21. April 2010" on this site.
LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Re: Spring link error

Post by LeroyLinux »

From the wiki:

Code: Select all

MINGDIR=C:/MinGW 
PATH=%PATH%;%MINGDIR%\bin 
You also need some Spring dependencies, prepackaged in the mingwlibs archive. 

You can get it here (Download Source button, or use git): 

mingwlibs for MinGW GCC 4.4 or newer 
mingwlibs for MinGW GCC 4.3 or older 
I downloaded the MinGW GCC 4.4 of newer link
Gahzi
Posts: 3
Joined: 25 May 2010, 22:00

Re: Spring link error

Post by Gahzi »

Yeah I see it now hoijui, sorry I was looking at the change log :)

Do you have any ideas about my other question involving the missing dll?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring link error

Post by hoijui »

Gahzi,
i do not get it.. you failed to compile but still tried to execute?

to both of you:
if that part is not in the README(.markdown) then you have the wrong version of mingwlibs. LeroyLinux, if you did get it from that link and the README does not contain this, then... maybe github is borked and always packs the master branch or something. try getting it with git clone then.
Gahzi
Posts: 3
Joined: 25 May 2010, 22:00

Re: Spring link error

Post by Gahzi »

hoijui, thanks for the help. I realized that I was cloning the master branch instead of the boost branch. After getting the right mingwlibs, I seemed to be get some linking errors. Check below.

Code: Select all

/home/robin/src/boost_1_42_0/libs/signals/src/named_slot_map.cpp:32: undefined reference to `_Unwind_SjLj_Resume'

/home/robin/src/boost_1_42_0/libs/signals/src/named_slot_map.cpp:32: undefined reference to `_Unwind_SjLj_Register'

/home/robin/src/boost_1_42_0/./boost/signals/connection.hpp:151: undefined reference to `__gxx_personality_sj0'

..\..\mingwlibs\lib\libboost_signalsmt.a(named_slot_map.o):/usr/lib/gcc/i686-mingw32/4.4.2/include/g++-v4/bits/stl_tree.h:1424: undefined reference to `_Unwind_SjLj_Unregister'
I know you mentioned that my minGW may be the issue since I may be running stuff that is not the proper version. I will try to look at this later on tonight/tomorrow.

On a side note, its strange how when I was running the wrong mingwlibs, I was able to build and link to a spring.exe file.

Finally, thanks for your help so far. I really appreciate the time you spend answering these questions.
LeroyLinux
Posts: 8
Joined: 21 May 2010, 02:12

Re: Spring link error

Post by LeroyLinux »

Sorry I haven't been around I know everyone missed me.

Anyway, I got the git mingwlibs and updated the spring source from git.

I get the following message now

Code: Select all

[ 14%] Built target oscpack
[ 14%] Built target minizip
Linking CXX executable ..\spring.exe
Creating library file: libspring.dll.a
C:\msys\1.0\home\Jason\spring\mingwlibs\lib\libboost_thread-mt.a(tss_pe.o):tss_pe.cpp:(.rdata$T+0x0): multiple definition of `_tls_used'
c:/msys/1.0/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(tlssup.o):tlssup.c:(.tls+0x0): first defined here
collect2: ld returned 1 exit status
mingw32-make[2]: *** [spring.exe] Error 1
mingw32-make[1]: *** [rts/CMakeFiles/spring.dir/all] Error 2
mingw32-make: *** [all] Error 2
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Spring link error

Post by hoijui »

try the boost_... branch of mingwlibs.
that will probably compile, but fail to run, cause it was compiled with SJLJ exceptions, instead of dwarf2.
... i will start setting up an Ubuntu VM, and see if i can cross-compile boost there.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Spring link error

Post by FLOZi »

Or not. That's the exact same error I was getting. even with my own compilation of boost 1.43 and koshi's cross-compiled boost 1.41. (both compiled with dwarf2)

Perhaps a problem with gcc 4.5? Though I tried tdm 4.4 and didn't have any luck with that either. :|

edit: Much of my messing around wasn't much helped by MinGW's files being unavailable. Probably my mingw tdm install was severely botched.
Last edited by FLOZi on 06 Jun 2010, 19:25, edited 1 time in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Spring link error

Post by FLOZi »

From GCC 4.5 release notes:
New features:
-------------

* New TLS support: thread local variables work without the
need for external DLLs.
I'm going to try the official 4.4 build and see if that works with the master git branch of mingwlibs.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Spring link error

Post by FLOZi »

Eh triple post.

I finally got it working by using an older mingwrt package, 3.17 instead of 3.18:

http://sourceforge.net/downloads/mingw/ ... gwrt-3.17/

Turns out the library in question is part of that, not gcc, so 4.5 will probably work too.

There's still the issue of boost having been compiled with sjlj, you can either build boost yourself or grab boost 1.41 that koshi cross compiled http://springlobby.info/temp/boost.tgz Dunno how long that will be available for. here: http://www.springlobby.info/windows/dll ... dwarf2.tgz
Last edited by FLOZi on 06 Jun 2010, 22:59, edited 1 time in total.
Post Reply

Return to “Engine”