Page 1 of 1

Compilation of spring-0.76 fails on Gentoo

Posted: 23 Jul 2008, 21:34
by Kaot
Hi all,

i not able to compile spring-0.76 on my Gentoo Box.
I get the following Errors:

gcc-4.3

Code: Select all

rts/System/AutohostInterface.cpp: In member function 'void AutohostInterface::SendPlayerJoined(unsigned char, const std::string&) const':
rts/System/AutohostInterface.cpp:81: error: 'strncpy' was not declared in this scope
rts/System/AutohostInterface.cpp: In member function 'void AutohostInterface::SendPlayerChat(unsigned char, const std::string&) const':
rts/System/AutohostInterface.cpp:104: error: 'strncpy' was not declared in this scope
scons: *** [build/rts/System/AutohostInterface.o] Error 1

If i switch back to gcc-4.2, i'm able to compile a bit further but still run into Errors:

gcc-4.2

Code: Select all

In file included from rts/lib/luabind/luabind/luabind.hpp:28,
                 from rts/System/Script/LuaFunctions.h:4,
                 from rts/System/Script/LuaFunctions.cpp:6:
rts/lib/luabind/luabind/class.hpp: In member function 'luabind::class_<T, X1, X2, X3>& luabind::class_<T, X1, X2, X3>::def(luabind::detail::operator_<Derived>, const Policies&)':
rts/lib/luabind/luabind/class.hpp:1027: error: no matching function for call to 'raw(boost::arg<1>&)'
rts/lib/luabind/luabind/class.hpp: In member function 'luabind::class_<T, X1, X2, X3>& luabind::class_<T, X1, X2, X3>::def(luabind::detail::operator_<Derived>)':
rts/lib/luabind/luabind/class.hpp:1037: error: no matching function for call to 'raw(boost::arg<1>&)'
In file included from rts/System/Script/LuaFunctions.cpp:16:
rts/Game/UI/EndGameBox.h: In member function 'void CEndGameBox::Stat::AddStat(int, float)':
rts/Game/UI/EndGameBox.h:51: error: call of overloaded 'fabs(float)' is ambiguous
/usr/include/bits/mathcalls.h:182: note: candidates are: double fabs(double)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/include/g++-v4/cmath:236: note:                 long double std::fabs(long double)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/include/g++-v4/cmath:232: note:                 float std::fabs(float)
rts/lib/streflop/SMath.h:554: note:                 streflop::Extended streflop::fabs(streflop::Extended)
rts/lib/streflop/SMath.h:431: note:                 streflop::Double streflop::fabs(streflop::Double)
rts/lib/streflop/SMath.h:241: note:                 streflop::Simple streflop::fabs(streflop::Simple)
rts/Game/UI/EndGameBox.h:52: error: call of overloaded 'fabs(float)' is ambiguous
/usr/include/bits/mathcalls.h:182: note: candidates are: double fabs(double)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/include/g++-v4/cmath:236: note:                 long double std::fabs(long double)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/include/g++-v4/cmath:232: note:                 float std::fabs(float)
rts/lib/streflop/SMath.h:554: note:                 streflop::Extended streflop::fabs(streflop::Extended)
rts/lib/streflop/SMath.h:431: note:                 streflop::Double streflop::fabs(streflop::Double)
rts/lib/streflop/SMath.h:241: note:                 streflop::Simple streflop::fabs(streflop::Simple)
rts/lib/luabind/luabind/yield_policy.hpp: At global scope:
rts/lib/luabind/luabind/yield_policy.hpp:57: warning: 'luabind::<unnamed>::yield' defined but not used
rts/lib/luabind/luabind/class.hpp:1332: warning: 'luabind::<unnamed>::pure_virtual' defined but not used
scons: *** [build/rts/System/Script/LuaFunctions.o] Error 1

I'm able to hack all the Source of Spring in Order fix all the Error-Messages, but if i start spring and join a Online-Battle, i'm able to load the Map but then spring quit with the Messages, that my Version
differs from the Servers one or something similar.


Nevertheless Gentoo EBuild for the spring-9999 (meaning the Version from the Repository) works fine, but with this Version i'm again unable to play online. :(

Does someone have a Hint how i can solve the Problem?
Is there perhaps a Version between 0.76 and Repository-Version, that is still compatible to 0.76 so i can play still online?

Thanks in Advance!

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 23 Jul 2008, 21:42
by BrainDamage
use gcc-4.3 and add

Code: Select all

#include "string.h"
to rts/System/AutohostInterface.cpp

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 23 Jul 2008, 21:51
by Kaot
Brain Damage wrote:use gcc-4.3 and add

Code: Select all

#include "string.h"
to rts/System/AutohostInterface.cpp
This is only the Tip of the Iceberg. I did this Fixing once with the Effect that i wasn't able to play because "My Versions differs from the Server's one."

There are a whole Bunch of this #include Lines to add, i spent about 20-30 Minutes to get it compiled to that still incompatible Version.

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 23 Jul 2008, 23:33
by YokoZar
I'm having the same FTBFS on Ubuntu Intrepid: viewtopic.php?f=12&t=15487

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 01 Oct 2008, 04:55
by keen101
I am also having this problem. I am also using Ubuntu 8.10 Intrepid Ibex.

I also found this:

http://forums.fedoraforum.org/showthread.php?t=193661

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 01 Oct 2008, 15:18
by imbaczek
try manually adding #include <string.h> somewhere along other includes in rts/System/AutohostInterface.cpp.

0.76 may not behave nice with gcc 4.3 btw. you'll need the 'next' branch from http://gitorious.org/projects/spring-sv ... /logs/next. it's a patched 0.76 compatible version with several bugs (at least one critical) fixed.

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 01 Oct 2008, 18:22
by SpliFF
I spent a lot of time trying to cross-compile 0.76 under various GCCs, no luck.

The only other options I know of are:

1.) Wait for 0.77
2.) Find someone with Spring on your distro and copy the binaries
3.) Try to cross-compile against GCC 3.4 or 4.1 (That's how old 0.76 is) and hope you do better than I did.
4.) Use the buildbot to build the 0.76 branch
5.) Help with testing the 0.77 branch (against AI or when devs are around to play)
6.) Use (ugh) windows, maybe even wine.

The main problem is that newer versions of GCC cracked down on ambiguous (sloppy) declarations. Only older GCCs (pre 4.2 I think) will ignore these. I had a lot of trouble getting any version of GCC to compile it but the buildbot managed to do it recently with 4.2 so there might be a trick to it or the svn 0.76 branch has the fixes.

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 03 Oct 2008, 03:41
by Nemoder
You can try my binary installer, I haven't tested it with gentoo but it works with most other distributions. Of course you don't get the memory savings of using your systems libs this way but if you just want to get the game running it should work.

viewtopic.php?f=20&t=12802

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 11 Oct 2008, 13:36
by Kaot
Hi again,
1.) Wait for 0.77
That worked. ;)
I'm now able to build 0.77b3.

Works also fine in Conjunction with Springlobby.

I started to wrote some EBuild for Modifications like "Complete Annihilation", which checks out from CVS/SVN and always builds and installs the newest CA Version.

I also wrote some EBuilds for Lua-Widgets, so that there is no Need to "pollute" the ~/.spring Directory and old Versions are automatically deinstalled, too.

Might there be some Interest in publishing such Stuff?
Maybe in an appropriate Overlay?

Greets,
Kaot

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 11 Oct 2008, 14:33
by koshi
http://trac.springlobby.info/ticket/309 :-)

Don't you already have access to modify the overlay?
What else would you need? A web/ftp accesible dir to upload stuff to?

Re: Compilation of spring-0.76 fails on Gentoo

Posted: 11 Oct 2008, 22:05
by Auswaschbar
Maybe give him access to git://springlobby.info/git/overlay/springlobby.git?