Zangband GNU Curses "Fatal Error" when run

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smbhax
    Swordsman
    • Oct 2021
    • 354

    Zangband GNU Curses "Fatal Error" when run

    After massacring makefiles and things for a bit I managed to compile what might be a GNU Curses version of Zangband 2.7.5.1 or whatever under Cygwin, but when trying to run it I get "Fatal Error."

    In an earlier thread where this kind of thing came up, backwardsEric said "Fatal Error" means it can't find the "libs" directory. Running it with "-help" says it has a command line option along those lines

    Code:
    -d<def> Define a 'lib' dir sub-path
    but I can't figure out how to use that. If anyone has any suggestions, I'd very much like to hear them. : )

    Update:

    src/z-config.h has two options that may be relevant to the lib thing:

    DEFAULT_PATH

    This defaults to "./lib/" but recommends that you change it to "the actual location of the 'lib' folder." Mine is under my Cygwin home, ~/zangband/lib/, so I tried setting it to "/zangband/lib/" before compiling, but "Fatal Error" persists.

    FIXED_PATHS

    This apparently "prevents usage" of the '-d<what=path' command line option. I tried commenting it out--but I still have no idea how to use -d, and it is giving me the same "bad semantics" and so forth errors when I try to guess at it.
    Last edited by smbhax; January 21, 2022, 09:23.
    My Angband videos
  • backwardsEric
    Knight
    • Aug 2019
    • 522

    #2
    When you set DEFAULT_PATH to "~/zangband/lib/", did you give it in exactly that form or in a form where the tilde had been replaced with the path to the home directory (i.e. what you would see if you ran "cd ~; pwd" from Cygwin's shell). It doesn't look like Zangband is prepared to handle the former so you'd have to give it the path where the tilde has already been replaced.

    For the -d options, it looks like the format it wants is like this:

    Code:
        -ds=your_path_here
    where the letter after "-d" sets which directory you're changing. The above changes the location of the save file directory. With a misconfigured DEFAULT_PATH, you'll have to override a lot of directories (-de=... -df=... ...), so I'd try to get the right DEFAULT_PATH and avoid trying to set the directories manually on Zangband's command line.

    Comment

    • smbhax
      Swordsman
      • Oct 2021
      • 354

      #3
      Originally posted by backwardsEric
      When you set DEFAULT_PATH to "~/zangband/lib/", did you give it in exactly that form or in a form where the tilde had been replaced with the path to the home directory (i.e. what you would see if you ran "cd ~; pwd" from Cygwin's shell). It doesn't look like Zangband is prepared to handle the former so you'd have to give it the path where the tilde has already been replaced.
      Thanks! Yeah z-config.h gave some example paths that did not include ~ so I guessed and just went with "/zangband/lib/" which not surprisingly still didn't work.

      "cd ~; pwd" gives me "/home/smbhax" so now I'm trying "/home/smbhax/zangband/lib/"... Still "Fatal Error" though.

      Actually hm this in the generated makefile looks suspicious

      Code:
      prefix = /usr/local
      exec_prefix = ${prefix}
      
      
      bindir = ${exec_prefix}/bin
      datadir = ${prefix}/share
      
      DESTDIR = $(datadir)/games/zangband/
      GAMEGROUP = games
      
      CFLAGS += -DDEFAULT_PATH=\"$(DESTDIR)lib/\"
      Commenting that CFLAGS += out and trying

      Code:
      CFLAGS := -Wall -O1 -pipe -g -D"USE_GCU" -DDEFAULT_PATH=\"/home/smbhax/zangband/lib/\"
      allows the game to launch. : ) But then it hangs at stat rolling with high CPU usage. Same result with no -DDEFAULT_PATH parameter set--falls back to ./lib/ then I suppose. Well, I have no idea what that is, drat...other than that it's all slightly reminiscent of where Hengband was quitting out with its setguid problem. Zangband has a z-config.h option to disable autoroller, but that causes compilation errors.
      Last edited by smbhax; January 21, 2022, 19:25.
      My Angband videos

      Comment

      • backwardsEric
        Knight
        • Aug 2019
        • 522

        #4
        Originally posted by smbhax
        But then it hangs at stat rolling with high CPU usage. Same result with no -DDEFAULT_PATH parameter set--falls back to ./lib/ then I suppose. Well, I have no idea what that is, drat...other than that it's all slightly reminiscent of where Hengband was quitting out with its setguid problem. Zangband has a z-config.h option to disable autoroller, but that causes compilation errors.
        There was a similar problem with Hengband 1.6.2 - on 64-bit systems the types it chose for fixed-size integers led to the random number initialization getting stuck. The change to src/h-types.h that was used to fix it is here (the change to configure.ac won't be relevant if you're not using autoconf and the configure script). Alternatively, compiling everything with "-DL64" included in CFLAGS may work too.

        Comment

        • smbhax
          Swordsman
          • Oct 2021
          • 354

          #5
          Originally posted by backwardsEric
          Alternatively, compiling everything with "-DL64" included in CFLAGS may work too.
          Dude, you know too much and it is amazing. That's got it running. : )
          My Angband videos

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9629

            #6
            Originally posted by smbhax
            Dude, you know too much and it is amazing.
            Excellent summary
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

            • Gwarl
              Administrator
              • Jan 2017
              • 1025

              #7
              FWIW I usually fix it like this:

              Comment

              • smbhax
                Swordsman
                • Oct 2021
                • 354

                #8
                Originally posted by Gwarl
                Thanks for sharing that. : ) The fact that you've had Zangband running in Curses on angband.live all this time is what gave me hope!
                My Angband videos

                Comment

                • Pete Mack
                  Prophet
                  • Apr 2007
                  • 6883

                  #9
                  Getting 64 bits working on windows wasnt too hard either. I think it took 4 changes.

                  Comment

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