PDA

View Full Version : Linux compiling under SuSE 9.3


TJA
August 14, 2007, 18:52
Hello,
i just tried ./configure and make and got the following:


In file included from main-gcu.c:63:
/usr/include/ncurses.h:337: error: syntax error before "bool"
/usr/include/ncurses.h:339: error: syntax error before "_leaveok"
/usr/include/ncurses.h:340: error: syntax error before "_scroll"
/usr/include/ncurses.h:341: error: syntax error before "_idlok"
/usr/include/ncurses.h:342: error: syntax error before "_idcok"
/usr/include/ncurses.h:343: error: syntax error before "_immed"
/usr/include/ncurses.h:344: error: syntax error before "_sync"
/usr/include/ncurses.h:345: error: syntax error before "_use_keypad"
/usr/include/ncurses.h:372: error: syntax error before '}' token
/usr/include/ncurses.h:393: error: syntax error before "is_term_resized"
/usr/include/ncurses.h:399: error: syntax error before "bool"
/usr/include/ncurses.h:521: error: syntax error before "can_change_color"
/usr/include/ncurses.h:525: error: syntax error before "bool"
/usr/include/ncurses.h:557: error: syntax error before "has_colors"
/usr/include/ncurses.h:558: error: syntax error before "has_ic"
/usr/include/ncurses.h:559: error: syntax error before "has_il"
/usr/include/ncurses.h:561: error: syntax error before "bool"
/usr/include/ncurses.h:562: error: syntax error before "bool"
/usr/include/ncurses.h:563: error: syntax error before "bool"
/usr/include/ncurses.h:577: error: syntax error before "bool"
/usr/include/ncurses.h:578: error: syntax error before "isendwin"
/usr/include/ncurses.h:579: error: syntax error before "is_linetouched"
/usr/include/ncurses.h:580: error: syntax error before "is_wintouched"
/usr/include/ncurses.h:582: error: syntax error before "bool"
/usr/include/ncurses.h:584: error: syntax error before "bool"
/usr/include/ncurses.h:586: error: syntax error before "bool"
/usr/include/ncurses.h:645: error: syntax error before "bool"
/usr/include/ncurses.h:650: error: syntax error before "bool"
/usr/include/ncurses.h:677: error: syntax error before "bool"
/usr/include/ncurses.h:703: error: syntax error before "bool"
/usr/include/ncurses.h:1413: error: syntax error before "wenclose"
/usr/include/ncurses.h:1415: error: syntax error before "wmouse_trafo"
/usr/include/ncurses.h:1415: error: syntax error before "bool"
/usr/include/ncurses.h:1416: error: syntax error before "mouse_trafo"
/usr/include/ncurses.h:1416: error: syntax error before "bool"
main-gcu.c: In function `Term_xtra_gcu_alive':
main-gcu.c:290: error: dereferencing pointer to incomplete type
main-gcu.c:290: error: dereferencing pointer to incomplete type
main-gcu.c:290: warning: left-hand operand of comma expression has no effect
main-gcu.c: In function `Term_nuke_gcu':
main-gcu.c:383: error: dereferencing pointer to incomplete type
main-gcu.c:383: error: dereferencing pointer to incomplete type
main-gcu.c:383: warning: left-hand operand of comma expression has no effect
main-gcu.c: In function `Term_xtra_gcu':
main-gcu.c:505: error: dereferencing pointer to incomplete type
main-gcu.c: In function `Term_text_gcu':
main-gcu.c:616: error: dereferencing pointer to incomplete type
main-gcu.c:630: error: dereferencing pointer to incomplete type
main-gcu.c: In function `init_gcu':
main-gcu.c:712: error: `bool' undeclared (first use in this function)
main-gcu.c:712: error: (Each undeclared identifier is reported only once
main-gcu.c:712: error: for each function it appears in.)
main-gcu.c:712: error: syntax error before "use_big_screen"
main-gcu.c:720: error: `use_big_screen' undeclared (first use in this function)
make[2]: *** [main-gcu.o] Error 1
make[1]: *** [build] Error 2
make: *** [build] Error 2



Any idea what could be wrong?

Daven_26d1
August 14, 2007, 19:06
Well, you could try updating ncurses, 9.3 is a fairly old build.

Before you do that though, try cding to /src and running

make -f Makefile.std


not forgetting the capital M in Makefile. That way may or may not work for you. :)

TJA
August 14, 2007, 23:33
Now, to be honest SuSE 9.3 may not be brand new, but surely young enough to compile an Roguelike game, donīt you think?

Thanx for you tip, it work partly:


make -f Makefile.std
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-file.o -c z-file.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-form.o -c z-form.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-rand.o -c z-rand.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-term.o -c z-term.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-type.o -c z-type.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-util.o -c z-util.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o z-virt.o -c z-virt.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o main-gcu.o -c main-gcu.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o main-sdl.o -c main-sdl.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o snd-sdl.o -c snd-sdl.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o main-x11.o -c main-x11.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o main-xaw.o -c main-xaw.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o main-gtk.o -c main-gtk.c
gcc -Wall -O2 -Wno-unused-parameter -DUSE_X11 -DUSE_GCU -DUSE_NCURSES -DHAVE_MKSTEMP -o angband birth.o cave.o cmd0.o cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o dungeon.o files.o generate.o init1.o init2.o load.o melee1.o melee2.o monster1.o monster2.o obj-info.o object1.o object2.o randart.o randname.o pathfind.o signals.o save.o spells1.o spells2.o squelch.o store.o tables.o ui.o use-obj.o util.o variable.o wizard1.o wizard2.o x-spell.o xtra1.o xtra2.o z-file.o z-form.o z-rand.o z-term.o z-type.o z-util.o z-virt.o main.o main-gcu.o main-sdl.o snd-sdl.o maid-x11.o main-x11.o main-xaw.o main-gtk.o -lX11 -lncurses
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
make: *** [angband] Error 1


Then i tried to run configure again, disabling everything beside curses:

Configuration:

Install path: /usr/local
lib/ path: ./lib/

-- Frontends --
- Curses Yes
- GTK 2.x Disabled
- X11 Disabled
- SDL Disabled


Still those errors:

main-gcu.c: In function `Term_xtra_gcu_alive':
main-gcu.c:290: error: dereferencing pointer to incomplete type
main-gcu.c:290: error: dereferencing pointer to incomplete type
main-gcu.c:290: warning: left-hand operand of comma expression has no effect
main-gcu.c: In function `Term_nuke_gcu':
main-gcu.c:383: error: dereferencing pointer to incomplete type
main-gcu.c:383: error: dereferencing pointer to incomplete type
main-gcu.c:383: warning: left-hand operand of comma expression has no effect
main-gcu.c: In function `Term_xtra_gcu':
main-gcu.c:505: error: dereferencing pointer to incomplete type
main-gcu.c: In function `Term_text_gcu':
main-gcu.c:616: error: dereferencing pointer to incomplete type
main-gcu.c:630: error: dereferencing pointer to incomplete type
main-gcu.c: In function `init_gcu':
main-gcu.c:712: error: `bool' undeclared (first use in this function)
main-gcu.c:712: error: (Each undeclared identifier is reported only once
main-gcu.c:712: error: for each function it appears in.)
main-gcu.c:712: error: syntax error before "use_big_screen"
main-gcu.c:720: error: `use_big_screen' undeclared (first use in this function)
make[2]: *** [main-gcu.o] Error 1
make[1]: *** [build] Error 2
make: *** [build] Error 2


I have those versions:

ncurses-devel-5.4-68
ncurses-5.4-68


Which curses version is needed?!?

takkaria
August 15, 2007, 01:01
Now, to be honest SuSE 9.3 may not be brand new, but surely young enough to compile an Roguelike game, donīt you think?


I have those versions:

ncurses-devel-5.4-68
ncurses-5.4-68


Which curses version is needed?!?

ncurses 5.5. (Not that I realised this before release; still, I don't really expect Unix users to be using three-year old package versions. :))

TJA
August 15, 2007, 01:16
Now, itīs a freshly set up root-Server at server4you.de
:)

BTW, this is the main problem of Linux - it is moving too fast and has very often no back-compatibility.
If you want to compile "something", you need to download and compile 1 to 20 other kits and libraries and tools more.
Solaris, for example, is much more professional in such things ...

*sob*

Thanx for your reply - i will try to get a newer ncurses :)

takkaria
August 15, 2007, 01:26
Now, itīs a freshly set up root-Server at server4you.de
:)

BTW, this is the main problem of Linux - it is moving too fast and has very often no back-compatibility.

Well, in this case, it's because ncurses uses its own boolean type of some kind, I believe, and the later versions allow you to stop it doing that; previous versions don't. I'm not sure you can be backward-compatible in this way.

If you want to compile "something", you need to download and compile 1 to 20 other kits and libraries and tools more.
Solaris, for example, is much more professional in such things ...

Well, I use Debian; if I want to compile something, I just apt-get the appropriate dev libraries. :) Solaris has the advantage of being pretty much centrally administered, where most things are developed by Sun. (Of course, this comes with bad side-effects, like really poor package management.)

TJA
August 15, 2007, 01:35
Yep, about Sun and their System V packages, you are right, of course.
But it works "somehow" and can even be patched :)

Anyway, i cannot find a *ncurses*5.5.* RPM for SuSE 9.3 on any page :-(
And i surely will not begin to compile whatever else may be needed.
Sad thing.

Thanx for your time!

And GOOD job, as far as i saw from the Windows version!
Thanx for continuing work on Vanilla Angband!

Daven_26d1
August 15, 2007, 10:54
The errors you got when compiling via make -f..etc is a problem I encountered on SuSE 10.1 with v3.0.8, tho the issue is fixed for me in v3.0.9.

Basically, the makefile hasn't detected your x-libs, or has incorrectly used the path.
Assuming that novell didn't change the tree structure between 9.3 & 10.1, see:

http://angband.oook.cz/forum/showthread.php?t=132

for a workaround that should get you up and running. Beware that I had a typo in the path I reported, but pav slyly corrects me right underneath my fix.

TJA
August 15, 2007, 12:45
Thanx for this tip, Daven!

My ncurses libraries are here:


rpm -qil ncurses-devel-5.4-68 ncurses-5.4-68 | grep ^\/ | grep lib | grep ncurs
/usr/lib/libncurses++.a
/usr/lib/libncurses++w.a
/usr/lib/libncurses.a
/usr/lib/libncurses.so
/usr/lib/libncursesw.so
/lib/libncurses.so.5
/lib/libncurses.so.5.4
/usr/lib/libncursesw.so.5
/usr/lib/libncursesw.so.5.4



So, i changed Makefile.std like this:


LIBS = -L/usr/X11R6/lib -L/usr/lib -L/lib


That did not help ...



In file included from main-gcu.c:63:
/usr/include/ncurses.h:337: error: syntax error before "bool"
/usr/include/ncurses.h:339: error: syntax error before "_leaveok"
/usr/include/ncurses.h:340: error: syntax error before "_scroll"
/usr/include/ncurses.h:341: error: syntax error before "_idlok"
/usr/include/ncurses.h:342: error: syntax error before "_idcok"
/usr/include/ncurses.h:343: error: syntax error before "_immed"
/usr/include/ncurses.h:344: error: syntax error before "_sync"
/usr/include/ncurses.h:345: error: syntax error before "_use_keypad"
/usr/include/ncurses.h:372: error: syntax error before '}' token
/usr/include/ncurses.h:393: error: syntax error before "is_term_resized"
/usr/include/ncurses.h:399: error: syntax error before "bool"
/usr/include/ncurses.h:521: error: syntax error before "can_change_color"
/usr/include/ncurses.h:525: error: syntax error before "bool"
/usr/include/ncurses.h:557: error: syntax error before "has_colors"
/usr/include/ncurses.h:558: error: syntax error before "has_ic"
/usr/include/ncurses.h:559: error: syntax error before "has_il"
/usr/include/ncurses.h:561: error: syntax error before "bool"
/usr/include/ncurses.h:562: error: syntax error before "bool"
/usr/include/ncurses.h:563: error: syntax error before "bool"
/usr/include/ncurses.h:577: error: syntax error before "bool"
/usr/include/ncurses.h:578: error: syntax error before "isendwin"
/usr/include/ncurses.h:579: error: syntax error before "is_linetouched"
/usr/include/ncurses.h:580: error: syntax error before "is_wintouched"
/usr/include/ncurses.h:582: error: syntax error before "bool"
/usr/include/ncurses.h:584: error: syntax error before "bool"
/usr/include/ncurses.h:586: error: syntax error before "bool"
/usr/include/ncurses.h:645: error: syntax error before "bool"
/usr/include/ncurses.h:650: error: syntax error before "bool"
/usr/include/ncurses.h:677: error: syntax error before "bool"
/usr/include/ncurses.h:703: error: syntax error before "bool"
/usr/include/ncurses.h:1413: error: syntax error before "wenclose"
/usr/include/ncurses.h:1415: error: syntax error before "wmouse_trafo"
/usr/include/ncurses.h:1415: error: syntax error before "bool"
/usr/include/ncurses.h:1416: error: syntax error before "mouse_trafo"
/usr/include/ncurses.h:1416: error: syntax error before "bool"
main-gcu.c: In function `Term_xtra_gcu_alive':
main-gcu.c:290: error: dereferencing pointer to incomplete type
main-gcu.c:290: error: dereferencing pointer to incomplete type
main-gcu.c:290: warning: left-hand operand of comma expression has no effect
main-gcu.c: In function `Term_nuke_gcu':
main-gcu.c:383: error: dereferencing pointer to incomplete type
main-gcu.c:383: error: dereferencing pointer to incomplete type
main-gcu.c:383: warning: left-hand operand of comma expression has no effect
main-gcu.c: In function `Term_xtra_gcu':
main-gcu.c:505: error: dereferencing pointer to incomplete type
main-gcu.c: In function `Term_text_gcu':
main-gcu.c:616: error: dereferencing pointer to incomplete type
main-gcu.c:630: error: dereferencing pointer to incomplete type
main-gcu.c: In function `init_gcu':
main-gcu.c:712: error: `bool' undeclared (first use in this function)
main-gcu.c:712: error: (Each undeclared identifier is reported only once
main-gcu.c:712: error: for each function it appears in.)
main-gcu.c:712: error: syntax error before "use_big_screen"
main-gcu.c:720: error: `use_big_screen' undeclared (first use in this function)
make[2]: *** [main-gcu.o] Error 1
make[1]: *** [build] Error 2
make: *** [build] Error 2


This does not look like "just a wrong ncurses" ...

:-O

I will try more and report here :)

takkaria
August 15, 2007, 12:59
This does not look like "just a wrong ncurses" ...

It is. Note all the errors occur around use of "bool". I have a fix for you, though: re-run "./configure", run "make clean"; edit autoconf.h in src/ and remove the lines mentioning HAVE_STDBOOL_H; recompile. It should work fine.

TJA
August 15, 2007, 13:06
I had a look at ncurses.h and found nothing special.
The syntax error occurs at a "bool" line ...
And about this, i found the following:



/* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also
* implement it. If so, we must use the C++ compiler's type to avoid conflict
* with other interfaces.
*
* A further complication is that <stdbool.h> may declare 'bool' to be a
* different type, such as an enum which is not necessarily compatible with
* C++. If we have <stdbool.h>, make 'bool' a macro, so users may #undef it.
* Otherwise, let it remain a typedef to avoid conflicts with other #define's.
* In either case, make a typedef for NCURSES_BOOL which can be used if needed
* from either C or C++.
*/


So, this may be a problem with ncurses and the defintion of "bool" itself?!?
Trying to force the cplusplus Variant did not help either.

TJA
August 15, 2007, 13:08
Found and fixed it!

I am not sure if that can be fixed from Angand and it´s Makefiles or not.

I change one line in ncurses.h:


typedef unsigned char NCURSES_BOOL;

#if defined(__cplusplus) /* __cplusplus, etc. */

/* use the C++ compiler's bool type */
#define NCURSES_BOOL bool

#else /* c89, c99, etc. */

#if 1
#include <stdbool.h>
/* use whatever the C compiler decides bool really is */
#define NCURSES_BOOL bool
#else
/* there is no predefined bool - use our own */
#undef bool
#define bool NCURSES_BOOL
#endif

#endif /* !__cplusplus, etc. */

#ifdef __cplusplus
extern "C" {
#endif


Do you see that "#if 1" line?
I changed it to "#if 0", forcing the definition of "bool" by ncurses ...

Result:


CC main-gcu.c
CC main-gtk.c
CC main-ros.c
CC main-sdl.c
CC main-win.c
CC main-x11.c
CC main-xaw.c
CC snd-sdl.c
CC z-file.c
CC z-form.c
CC z-rand.c
CC z-term.c
CC z-type.c
CC z-util.c
CC z-virt.c
LINK angband


So, my OLD, old ncurses 5.4 is still young enough to compile Angband :) :)

Thanx!

Daven_26d1
August 15, 2007, 14:46
heh, well done - but you should never have had to do this!

Anyway, after that headache of an install, basic V will be far too simple for you; may I suggest pt-based mode, with ironman_stairs, artifact_no_preserve and all the AI options set ('cept maybe smart_cheat - that one is *sick*). With a kobold. You know you want too!

Glad you're up and running; enjoy yourself - and welcome to oook!

EDIT - I have to say takkaria's fix is probably a better idea than your own hack; it's mostly sensible to modify source/makefiles etc in your target, not generic dependant libs.

TJA
August 15, 2007, 15:18
Yep, problem is, that i read his answer only now after you mentioned it - did not notice it before and was just trying myself ...


Now i just comment out the HAVE_STDBOOL_H line in src/autoconf.h.in and am ready for all situation and re-configures and compiles :)

Works like a charm.

TJA
August 15, 2007, 15:34
Now i tried to add the borg:


CC cmd0.c
cmd0.c:281: error: conflicting types for `do_cmd_try_borg'
cmd0.c:44: error: previous declaration of `do_cmd_try_borg'
cmd0.c: In function `do_cmd_try_borg':
cmd0.c:292: warning: `return' with no value, in function returning non-void
make[2]: *** [cmd0.o] Error 1
make[1]: *** [build] Error 2
make: *** [build] Error 2



Edit: "BORG" is only mentioned in Makefile.osx and Makefile.ros

:-O

Or do i need more than the regular VA to use this option in config.h?!?

takkaria
August 15, 2007, 15:40
Now i tried to add the borg:

You're trying to add the 3.0.6 borg to the game. Don't do that. :)

TJA
August 15, 2007, 15:45
Donīt want to bug you with more questions - just one:

Is it possible to compile and use a bot / borg for VA 3.0.9?
If yes, can you point me to a documentation?
If not, sad :)

Thanx!
:)

Daven_26d1
August 15, 2007, 15:53
The 3.0.9 borg is unfinished as of yet, but I think you can get a test version. The maintainer of the bot has a thread in the V forums here.

TJA
August 15, 2007, 15:59
Sadly, i discover more problems with compiling VA:


./configure --prefix=/usr/local --disable-x11


gives

Configuration:

Install path: /usr/local
lib/ path: ./lib/

-- Frontends --
- Curses Yes
- GTK 2.x Disabled
- X11 Disabled
- SDL Disabled


A "make install" does nothing but copy "angband" one level up:

make install
INSTALL angband (-> ..)


No installation in /usr/local - and if i do that manually, this copy does not run:

angband
angband: Cannot access the './lib/file/news.txt' file!

The 'lib' directory is probably missing or broken.
Perhaps the archive was not extracted correctly.
See the 'readme.txt' file for more information.

So, there are more things that need to be copied to /usr/local ...
But even then, this will not work as "angband" searches them in the current directory!!!

Very strange.

:-O

TJA
August 15, 2007, 16:03
And "Esc" does not seem to work ...

Edit: Found the "Backtick" workaround (`´`) - still strange.

pav
August 15, 2007, 23:10
Hehe, yeah a lot of people expect --prefix to ./configure will do that.

But not here! I don't grok how takkaria managed to rip out such a basic functionality of autoconf/automake (grin) but you will have to pass magic argument --with-setgid=games to have it install under --prefix...

TJA
August 16, 2007, 08:49
Oh.

That did it :)

Configuration:

Install path: /usr/local
lib/ path: /usr/local/share/angband/

Even the "make install" worked!

Strange thing :)

Edit: Needed to add chmod g+s on angband to be able to read savefiles ...

The development environment is in a bad condition, IMHO.