Build failure on Fedora 12 (gcc 4.4.2)

Build failure on Fedora 12 (gcc 4.4.2)

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

Moderator: Moderators

Post Reply
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

Hi all,

I'm trying to build Spring 0.80.5.2 on Fedora 12 (gcc 4.4.2) and I get this failure at the linking stage :

Code: Select all

CMakeFiles/spring.dir/Game/SelectMenu.cpp.o: In function `SelectMenu::Update()':
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/Game/SelectMenu.cpp:212: undefined reference to `Connection::Poll()'
CMakeFiles/spring.dir/System/UpdaterWindow.cpp.o: In function `UpdaterWindow':       
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.cpp:14: undefined reference to `Connection::Connection()'
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.cpp:26: undefined reference to `Connection::Connect(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'           
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.cpp:27: undefined reference to `Connection::~Connection()'
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.cpp:14: undefined reference to `Connection::Connection()'
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.cpp:26: undefined reference to `Connection::Connect(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'           
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.cpp:27: undefined reference to `Connection::~Connection()'
CMakeFiles/spring.dir/System/UpdaterWindow.cpp.o: In function `~UpdaterWindow':         
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.h:16: undefined reference to `Connection::~Connection()'
/home/pkg/fedora/pkgs/spring/F-12/spring_0.80.5.2/rts/System/UpdaterWindow.h:16: undefined reference to `Connection::~Connection()'
Any idea what's happening here ? Thanks !
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by Auswaschbar »

Strange, that should not happen.

1. Did you start from a clean build directory?
2. Were there any errors before this one?
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

Yes, I started from a clean tarball and ran :

Code: Select all

cmake -DDATADIR:PATH=share/spring -DLIBDIR:PATH=lib
Before these lines are a "Linking CXX executable ../spring" message in red, followed by several screenful of files being linked, ending with :

Code: Select all

 -o ../spring -rdynamic -lopenal -logg -lvorbisfile -lvorbis -lGL -lGLU -lGLEW -lIL -lILU -L/usr/lib -Wl,--export-dynamic -lalleg-4.2.2 -lalleg_unsharable -lfreetype -lX11 -lXcursor -lSDL -lpthread -lboost_regex-mt -lboost_thread-mt -lboost_program_options-mt -lboost_system-mt -lboost_signals-mt lib/liblua.a lib/lib7zip.a lib/libhpiutil2.a lib/liboscpack.a lib/libminizip.a lib/streflop/libstreflop.a lib/liblobby.so -lz -lboost_thread-mt -lboost_system-mt
ofaurax
Posts: 2
Joined: 22 Dec 2009, 22:57

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by ofaurax »

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

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by hoijui »

could you try compiling latest spring master?
also, talk to devs on the lobby, for more comfortable problem finding.
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

It does build here with the git master. I'm trying to extract which change caused the build to work, but it's pretty hard for me...
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by hoijui »

git has some tools that can help you there.
for example, if you think you know which file could contian the fix, you can search for commits that changed this file with gitk. an other thing to use is git bisect (you'll find info about it online or in the man page).
sorry if you already knew ;-)
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

Actually, it's not fixed in git master. It's rather hard to say, but I think it comes from one of my compilation options. I tried running make without "-j4" but it's not that either.

I'll keep looking...
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

I think I tracked it back to this CMake option

Code: Select all

-DBUILD_SHARED_LIBS:BOOL=ON 
With it, the build fails, and without it it completes.

Olivier, can you confirm this ?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by hoijui »

CMake Docu wrote: add_library(<name> [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] source1 source2 ... source)
If no type is given explicitly the type is STATIC or SHARED based on whether the current value of the variable BUILD_SHARED_LIBS is true.
how did that flag get in there??

guess we should make all types explicit though. i will do that.
thanks for finding!

edit:
made all add_library() calls in our CMake build files explicit (there was only this one for lib-lobby that was not).
ofaurax
Posts: 2
Joined: 22 Dec 2009, 22:57

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by ofaurax »

Yes, same here.
-DBUILD_SHARED_LIBS:BOOL=ON --> Fail
-DBUILD_SHARED_LIBS:BOOL=OFF --> Build
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

hoijui wrote: how did that flag get in there??
It's in the default cmake command when building Fedora RPMs.
hoijui wrote: guess we should make all types explicit though. i will do that.
Thanks !
abompard
Posts: 19
Joined: 17 Jan 2009, 18:26

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by abompard »

I confirm it does build with rpm's default cmake command after adding this commit:
http://github.com/spring/spring/commit/ ... a20a839246

Thanks a lot hoijui !
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Build failure on Fedora 12 (gcc 4.4.2)

Post by hoijui »

:D was really no work for me; you did it.
i also added the commit to the 0.80.5-branch, which can be compiled to play online (contains some more fixes then the current tarball on top of 0.80.5.2).
Post Reply

Return to “Engine”