Compiling error in 12383

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Compiling error in 12383

Post by huginn »

I did a clean checkout of trunk/vegastrike and ran bootstrap-sh, configure and make. Compiling stops with the following error

Code: Select all

depbase=`echo src/networking/lowlevel/vsnet_dloadenum.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	g++ -DHAVE_CONFIG_H -I.   -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I./boost/1_35    -DHAVE_SDL=1 -DSDL_WINDOWING=1      -DHAVE_AL=1   -DHAVE_OGG   -I/usr/include/python2.5 -DHAVE_PYTHON=1    -I./src   -pipe -O0 -gdwarf-2 -g3  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -MT src/networking/lowlevel/vsnet_dloadenum.o -MD -MP -MF $depbase.Tpo -c -o src/networking/lowlevel/vsnet_dloadenum.o src/networking/lowlevel/vsnet_dloadenum.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
./src/gnuhash.h:119: Fehler: expected declaration before »}« token
make[1]: *** [src/networking/lowlevel/vsnet_dloadenum.o] Fehler 1
This is on a Linux, Kubuntu Feisty (7.04), gcc-Version 4.1.2 (Ubuntu 4.1.2-0ubuntu4).

Edit
There are similar bug reports on the Bugtracker: 2007809, 2011001, and 2011020.

I tried to understand the error, looked at gnuhash.h, which seems OK to me (regarding all the ifdefs, {, and } ), and the preprocessor output with -E.

Funnily the preprocessor ignores the first HAVE_TR1_UNORDERED_MAP and defines everything into the __gnu_ext namespace, but then includes the extra } of the HAVE_TR1_UNORDERED_MAP block at the end of gnuhash.h. ??? I'm confused ...

I had no problems compiling the slightly older 12377.

I added the config.log as attachment.
You do not have the required permissions to view the files attached to this post.
Last edited by huginn on Sat Jul 05, 2008 3:54 pm, edited 1 time in total.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

I had no problems building svn12383 but then fedora use gcc 4.3 IIRC from the svn log that change was to accommodate backwards compatibility with gcc 4.1 if so looks like it's not correct :wink:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

Edit
More debug information deleted, as not necessary anymore.
Last edited by huginn on Sat Jul 05, 2008 4:24 pm, edited 1 time in total.
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

Ah, got it, but I really do not know how to solve it. This should help anyway.

gnuhash.h undef's HAVE_TR1_UNORDERED_MAP in #5-11

Code: Select all

#ifdef HAVE_TR1_UNORDERED_MAP
#ifndef WIN32
#if __GNUC__ < 4 || __GNUC_MINOR__ < 3
#undef HAVE_TR1_UNORDERED_MAP
#endif
#endif
#endif
But it indirectly redefines it in #54 via the hashtable.h include

Code: Select all

./src/gnuhash.h:54   #include "hashtable.h"
./src/hashtable.h:24   #include "config.h"
./config.h:280   #define HAVE_TR1_UNORDERED_MAP 1
and therefore prints an extra } without corresponding { almost at the end of gnuhash.h.

Edit
Thinking about it, the above undef code should actually appear in config.h.
safemode
Developer
Developer
Posts: 2150
Joined: Mon Apr 23, 2007 1:17 am
Location: Pennsylvania
Contact:

Post by safemode »

I think i understand what's happening.

automake's config.h is not "ifdef"'d like a normal header. Meaning you can include it infinite times during a build

cmake's is ifdef'd like a normal header, meaning it's only included once.

In automake, we're redefining the variable when we include the hashtable and such headers in gnuhash.h.

In cmake, we're not.


I just commited some minor updates to configure.ac that should fix the problem for you. You'll have to rerun bootstrap.sh or autoheader manually then reconfigure. That should re-create your config.h.in and config.h files.

You'll notice some standard header ifndef's at the top of config.h now and that should stop the compile error from occuring in gnuhash.h


edit: If you feel adventurous, grab cmake and try it out. Its always nice to have some people who know their way around building projects to help debug new building infrastructures.
Ed Sweetman endorses this message.
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

Svn 12385 compiles fine again. Thank you! :)
Post Reply