Sty+Ct Build Error

For all the help you need with Armagetron!
Post Reply
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Sty+Ct Build Error

Post by Light »

So, I'm curious if I'm doing something wrong / missing something, or if there's an issue with the current bzr for sty+ct. Attempting to containerize a server and potentially run them in a cluster, but step 1 is successfully building I guess.

Configure

Code: Select all

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether ln -s works... yes
checking for m4... true
checking for style of include used by make... GNU
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking CXXFLAGS for gcc -nobodyreadsconfigureoutputanyway... no, unknown
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for gmake... no
checking for bash... yes
checking whether make understands sinclude... yes
checking for socklen_t... yes
checking for xmlParseMemory in -lxml2... yes
checking for xmlParserInputBufferCreateFilenameDefault... yes
checking for zthread-config... /usr/bin/zthread-config
checking for ZTHREAD - version >= 2.3.2... yes
checking for exp in -lm... yes


 Configuring dedicated server, skipping libraries...
 
checking for ANSI C header files... no
checking unistd.h usability... yes
checking unistd.h presence... yes
checking for unistd.h... yes
checking for an ANSI C-conforming const... yes
checking for select... yes
checking for isblank... yes
checking for atan2f... yes
checking for sinf... yes
checking for cosf... yes
checking for tanf... yes
checking for sqrtf... yes
checking for logf... yes
checking for expf... yes
checking for fabsf... yes
checking for floorf... yes
checking for wmemset... yes
checking whether to bend localstatedir to /var... yes
checking alternative binary path /root/armagetronad/bin/games... no
checking alternative binary path /root/armagetronad/games... no
checking alternative binary path /root/armagetronad/games/bin... no
checking for /proc/self/maps... yes
checking whether everything is installed to the same prefix... yes
checking whether binary relocation support should be enabled... yes
checking for pthread_getspecific in -lpthread... yes
checking whether binary relocation should use threads... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating src/first/Makefile
config.status: creating Makefile
config.status: creating batch/Makefile
config.status: creating language/languages.txt
config.status: creating config/rc.config
config.status: creating config/aiplayers.cfg
config.status: creating src/doc/Makefile
config.status: creating src/doc/net/Makefile
config.status: creating src/doc/Doxyfile
config.status: creating src/doc/html.m4
config.status: creating src/thirdparty/Makefile
config.status: creating src/thirdparty/particles/Makefile
config.status: creating resource/Makefile
config.status: creating config/Makefile
config.status: creating desktop/Makefile
config.status: creating desktop/armagetronad.desktop
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing universal_variables commands
updating src/tUniversalVariables.h.in
updating universal_variable_values_makefile
config.status: executing pathsubstitution commands
Configuration complete!

Options selected are:
     Build Regular Game Client: false
     Build Dedicated Server: true
     Build Master Server: false

Installation options:
     Prefix: /root/armagetronad

     Build with Armathentication support (server): yes
     Init scripts will be installed in  : /etc/init.d
     Dynamic data will be kept in       : /var/games/armagetronad-dedicated
     PID files will be kept in          : /var/run
     Log files will be kept in          : /var/log
     Add user to run server             : no

     Binaries will be installed in      : ${prefix}/bin
     Static data will be installed in   : ${prefix}/share/games/armagetronad-dedicated
     Configuration will be installed in : ${prefix}/etc/games/armagetronad-dedicated
     Documentation will be installed in : ${datadir}/doc/games/armagetronad-dedicated
     Music support: no
     Build with Krawall authentication support: no
     Use dirty SDL initialization: no
     Call sysinstall: no
     Generate uninstall: no
     Allow multiple versions: no
     Use custom memory manager: no
     Debug level : 0
     Code level  : 0
     CPPFLAGS    : -I. -I..  -I/usr/include/libxml2
     CXXFLAGS    :  -O2 -Wno-long-long -I/usr//include -DREENTRANT -DZT_POSIX -fpermissive
     LIBS        : -lpthread -lm -lxml2  -L/usr//lib -lZThread -lpthread -lrt
Make

Code: Select all

...
./tools/tString.h:209:7: note:   'const std::__cxx11::basic_stringstream<char>' is not derived from 'const std::__shared_ptr<_Tp, _Lp>'
     S << c << '\0';
     ~~^~~~
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/stdexcept:39,
                 from /usr/include/c++/6/array:39,
                 from /usr/include/c++/6/tuple:39,
                 from /usr/include/c++/6/functional:55,
                 from /usr/include/c++/6/memory:79,
                 from ./defs.h:46,
                 from tron/gStuff.h:40,
                 from tron/gGame.cpp:29:
/usr/include/c++/6/bits/basic_string.h:5325:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator<<(basic_ostream<_CharT, _Traits>& __os,
     ^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5325:5: note:   template argument deduction/substitution failed:
In file included from ./engine/eSound.h:34:0,
                 from tron/gGame.cpp:30:
./tools/tString.h:209:7: note:   'const std::__cxx11::basic_stringstream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
     S << c << '\0';
     ~~^~~~
Makefile:2349: recipe for target 'tron/libtron_a-gGame.o' failed
make[2]: *** [tron/libtron_a-gGame.o] Error 1
make[2]: Leaving directory '/root/0.2.8-armagetronad-sty+ct/src'
Makefile:2677: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/root/0.2.8-armagetronad-sty+ct/src'
Makefile:657: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Sty+Ct Build Error

Post by Light »

Sty+Ct+Ap failed for me as well, so I'm assuming it's definitely something on my part. :(

Code: Select all

g++   -I./tools  -I./render -I./ui     -I./network -I./engine  -I./thirdparty/particles -I./tron  -O2 -Wno-long-long -I/usr//include -DREENTRANT -DZT_POSIX -fpermissive   -o armagetronad_main tron/armagetronad_main-gFloor.o libtron.a libenginecore.a libengine.a libnetwork.a libui.a librender.a libtools.a -lpthread -lm -lxml2  -L/usr//lib -lZThread -lpthread -lrt
libengine.a(libengine_a-ePlayer.o): In function `se_IsUserBanned(ePlayerNetID*, tString const&)':
ePlayer.cpp:(.text+0xa7c): undefined reference to `tOutput::operator<<(tOutput const&)'
libengine.a(libengine_a-ePlayer.o): In function `ePlayerNetID::WaitToLeaveChat()':
ePlayer.cpp:(.text+0x254b): undefined reference to `tOutput::operator<<(tOutput const&)'
libengine.a(libengine_a-ePlayer.o): In function `ePlayerNetID::Suspend(int, tString)':
ePlayer.cpp:(.text+0x3cfe): undefined reference to `tOutput::operator<<(tOutput const&)'
ePlayer.cpp:(.text+0x3dd8): undefined reference to `tOutput::operator<<(tOutput const&)'
libengine.a(libengine_a-ePlayer.o): In function `se_RequestLogin(ePlayerNetID*)':
ePlayer.cpp:(.text+0x5030): undefined reference to `tOutput::operator<<(tOutput const&)'
libengine.a(libengine_a-ePlayer.o):ePlayer.cpp:(.text+0x51c0): more undefined references to `tOutput::operator<<(tOutput const&)' follow
collect2: error: ld returned 1 exit status
Makefile:1101: recipe for target 'armagetronad_main' failed
make[3]: *** [armagetronad_main] Error 1
make[3]: Leaving directory '/root/0.2.9-armagetronad-sty+ct+ap/src'
Makefile:2739: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/root/0.2.9-armagetronad-sty+ct+ap/src'
Makefile:657: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/0.2.9-armagetronad-sty+ct+ap'
Makefile:475: recipe for target 'all' failed
make: *** [all] Error 2
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Sty+Ct Build Error

Post by Z-Man »

Looks like you're using GCC 6; we did some fixes for that on 0.2.8 last year. The error from sty+ct+ap is the one that was fixed, the fix is in r1462 which, judging from the timestamps, hasn't been merged yet into sty+ct+ap or sty+ct. You should do so locally. I think I have push rights to the ct branch, I'll try if I can push a minimal merge up there.
Edit: the error from ct+sty alone is unfamiliar.
Edit2: Ah, an unrelated gcc 6 error it was. Dunno how the code was working before, it was using std::ostream << std::stringstream... It's fixed now and the minimal merges have been pushed.
I can't do anything about ap, though. You'll need to merge these patches, bzr merge gives too many merge conflicts for me to even think about fixing:

Code: Select all

=== modified file 'src/tools/tLocale.cpp'
--- src/tools/tLocale.cpp	2012-06-30 00:26:57 +0000
+++ src/tools/tLocale.cpp	2016-07-11 19:17:38 +0000
@@ -733,6 +733,13 @@
 
 // and a special implementation for the locales and strings:
 tOutput& operator << (tOutput &o, const char *locale){
+    return o.AddString(locale);
+}
+
+tOutput & tOutput::AddString(char const * locale)
+{
+    tOutput & o = *this;
+
     int len = strlen(locale);
     if (len == 0)
         return o;

=== modified file 'src/tools/tLocale.h'
--- src/tools/tLocale.h	2012-06-30 00:26:57 +0000
+++ src/tools/tLocale.h	2016-07-11 19:17:38 +0000
@@ -82,7 +82,7 @@
 
     tOutputItemBase *anchor;
 
-    tOutput& operator << (const tOutput &o);
+    // tOutput& operator << (const tOutput &o);
 public:
     tOutput();
     ~tOutput();
@@ -92,6 +92,7 @@
     void AddLiteral(const char *);       // adds a language independent string
     void AddLocale(const char *);        // adds a language dependant string
     void AddSpace();                     // adds a simple space
+    tOutput & AddString(char const * pString); // checks the string, delegates to correct Add...()-Function
 
     // set a template parameter at this position of the output string
     tOutput & SetTemplateParameter(int num, const char *parameter);
@@ -114,7 +115,7 @@
 
         SetTemplateParameter(1, template1);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     template< class T1, class T2 >
@@ -126,7 +127,7 @@
         SetTemplateParameter(1, template1);
         SetTemplateParameter(2, template2);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     template< class T1, class T2, class T3 >
@@ -139,7 +140,7 @@
         SetTemplateParameter(2, template2);
         SetTemplateParameter(3, template3);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     template< class T1, class T2, class T3, class T4 >
@@ -153,7 +154,7 @@
         SetTemplateParameter(3, template3);
         SetTemplateParameter(4, template4);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     tOutput(const tOutput &o); // copy constructor

(I hope that did not destroy whitespace and piss off patch)

Code: Select all

=== modified file 'src/tron/gGame.cpp'
--- src/tron/gGame.cpp	2015-12-11 03:44:49 +0000
+++ src/tron/gGame.cpp	2017-04-04 20:49:24 +0000
@@ -1302,7 +1302,7 @@
                 const tString command_str = params.SubStr(interval_str.Len());
                 command << command_str;
                 tConfItemBase::LoadAll(command); // run command if it's not too old, otherwise, just skip it ...
-                con << command << " " << interval <<"\n";
+                con << command.str() << " " << interval <<"\n";
                 if (interval>0){
                     delayedCommands::Add(currentTime+interval,command.str(),interval);
                 }
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Sty+Ct Build Error

Post by Light »

Well, I ran the patches and still got failures, but knowing gcc6 was the issue, I just used an Ubuntu 15.10 image to build on. Got it to work! :) Thank you!
Post Reply