Linux compiling under SuSE 9.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TJA
    Adept
    • Aug 2007
    • 117

    Linux compiling under SuSE 9.3

    Hello,
    i just tried ./configure and make and got the following:

    Code:
    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
    Adept
    • Jun 2007
    • 211

    #2
    Well, you could try updating ncurses, 9.3 is a fairly old build.

    Before you do that though, try cding to /src and running
    Code:
    make -f Makefile.std
    not forgetting the capital M in Makefile. That way may or may not work for you.
    You sold a Broken Sword (1d2) (-2,-4) {average} (j) for 1 gold.
    The shopkeeper howls in agony!
    You say "Dude, the clue is in the name...".

    Comment

    • TJA
      Adept
      • Aug 2007
      • 117

      #3
      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:

      Code:
      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:
      Code:
      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?!?
      Last edited by TJA; August 14, 2007, 22:45.

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        Originally posted by TJA
        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. )
        takkaria whispers something about options. -more-

        Comment

        • TJA
          Adept
          • Aug 2007
          • 117

          #5
          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

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            Originally posted by TJA
            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.)
            takkaria whispers something about options. -more-

            Comment

            • TJA
              Adept
              • Aug 2007
              • 117

              #7
              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!

              Comment

              • Daven_26d1
                Adept
                • Jun 2007
                • 211

                #8
                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:



                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.
                You sold a Broken Sword (1d2) (-2,-4) {average} (j) for 1 gold.
                The shopkeeper howls in agony!
                You say "Dude, the clue is in the name...".

                Comment

                • TJA
                  Adept
                  • Aug 2007
                  • 117

                  #9
                  Thanx for this tip, Daven!

                  My ncurses libraries are here:

                  Code:
                  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:

                  Code:
                  LIBS = -L/usr/X11R6/lib -L/usr/lib -L/lib
                  That did not help ...


                  Code:
                  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

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    Originally posted by TJA
                    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.
                    takkaria whispers something about options. -more-

                    Comment

                    • TJA
                      Adept
                      • Aug 2007
                      • 117

                      #11
                      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.

                      Comment

                      • TJA
                        Adept
                        • Aug 2007
                        • 117

                        #12
                        Found and fixed it!

                        I am not sure if that can be fixed from Angand and it&#180;s Makefiles or not.

                        I change one line in ncurses.h:

                        Code:
                        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:

                        Code:
                                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!

                        Comment

                        • Daven_26d1
                          Adept
                          • Jun 2007
                          • 211

                          #13
                          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.
                          Last edited by Daven_26d1; August 15, 2007, 13:53.
                          You sold a Broken Sword (1d2) (-2,-4) {average} (j) for 1 gold.
                          The shopkeeper howls in agony!
                          You say "Dude, the clue is in the name...".

                          Comment

                          • TJA
                            Adept
                            • Aug 2007
                            • 117

                            #14
                            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.

                            Comment

                            • TJA
                              Adept
                              • Aug 2007
                              • 117

                              #15
                              Now i tried to add the borg:

                              Code:
                                      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?!?

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎