Compiling Hengband: "fatal error: util.h: No such file or directory"

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Gwarl
    replied
    Managed to compile 3.0.0Alpha51 on my local machine, but when I try it on the angband.live server I run into this:

    In file included from /usr/include/c++/8/memory:80,
    from ./stdafx.h:9,
    from <command-line>:
    /usr/include/c++/8/bits/unique_ptr.h: In instantiation of ‘typename std::enable_if<std::is_convertible<_Up (*)[], _Tp (*)[]>::value>::type std::default_delete<_Tp []>:perator()(_Up*) const [with _Up = object_type; _Tp = object_type; typename std::enable_if<std::is_convertible<_Up (*)[], _Tp (*)[]>::value>::type = void]’:
    /usr/include/c++/8/bits/unique_ptr.h:537:17: required from ‘std::unique_ptr<_Tp [], _Dp>::~unique_ptr() [with _Tp = object_type; _Dp = std::default_delete<object_type []>]’
    ./store/store-util.h:49:42: required from here
    /usr/include/c++/8/bits/unique_ptr.h:113:16: error: invalid application of ‘sizeof’ to incomplete type ‘object_type’
    static_assert(sizeof(_Tp)>0,
    ^~~~~~~~~~~
    Makefile:4988: recipe for target 'birth/character-builder.o' failed
    I'm pretty stumped

    Leave a comment:


  • smbhax
    replied
    Originally posted by backwardsEric
    The most recent update to the master branch for Hengband has a change that may fix the problem you saw with escalating/dropping privileges on Cygwin. If you have a chance, it's probably worth trying it out and reporting the results on the issue you filed.

    The problem with the executable name clashing with the directory for the Visual Studio project files when the file system is case-insensitive is still there. Easiest workaround is likely to move the Hengband directory to another name before building.
    Thanks! Looks like you've got that and the uid-checker thing fixed very neatly, the game runs now. =))))

    Leave a comment:


  • backwardsEric
    replied
    The most recent update to the master branch for Hengband has a change that may fix the problem you saw with escalating/dropping privileges on Cygwin. If you have a chance, it's probably worth trying it out and reporting the results on the issue you filed.

    The problem with the executable name clashing with the directory for the Visual Studio project files when the file system is case-insensitive is still there. Easiest workaround is likely to move the Hengband directory to another name before building.

    Leave a comment:


  • smbhax
    replied
    Hourier replied on their git to say
    I investigated this issue and found that util.h is not used any more.
    (quit() was defined in the header once but now it moved to z-util.cpp/h)

    So, would you please try to compile Hengband with uid-checker.cpp L3-9 (inclusion of util.h) removed?
    This file includes z-util.cpp/h indirectly (uid-checker.cpp => angband.h => z-util.h), so there may be no problem.
    I tried that--having reverted the comment to h-config.h--and the program compiled, but attempting to launch it gives "Fatal Error"--which I have reported to them.

    Actually, depending on how I try running it, it may say a few different things--I list these in the github issue. For instance, if I try "./hengband" from home/[username]/hengband/ (I have the game and /src/ etc in that folder I made--but I have to rename home/[username]/hengband/Hengband/ to home/[username]/hengband/zHengband/ or something first, otherwise I get "is a directory" : P), it responds with "setuid(): cannot set permissions correctly!"
    Last edited by smbhax; January 9, 2022, 15:53.

    Leave a comment:


  • smbhax
    replied
    Originally posted by backwardsEric
    That looks like a bug. I'd post an issue about it on Hengband's issue list. My guess as to why they haven't seen it when they compile for Linux is that SAFE_SETUID_POSIX somehow isn't set there while it is set on cygwin. Commenting out lines 51 to 53 of src/system/h-config.h (i.e. replace

    Code:
      #ifdef _POSIX_SAVED_IDS
        #define SAFE_SETUID_POSIX
      #endif
    with

    Code:
    #if 0
      #ifdef _POSIX_SAVED_IDS
        #define SAFE_SETUID_POSIX
      #endif
    #endif
    ) and recompiling may work around the problem.
    Thanks for taking a look! Tried that workaround, and the game compiles, but dies with "Fatal Error" when run.

    (There's also the odd issue that trying to run ./hengband gives a "is a directory" error; renaming /hengband/Hengband/ to something that is not "Hengband" seems to dodge that (looks like all that's in that directory are vc proj files?), but there's probably a less hacky way to do that.)

    I entered the "util.h" compiling error on their repo, and included your comment: https://github.com/hengband/hengband/issues/1971

    Update:

    They replied almost instantly, fixed my issue title (I'd overlooked it and left it as the Japanese placeholder text, urk), and said they would fix the problem: they've added it to their Alpha 52 milestone. : )

    Leave a comment:


  • backwardsEric
    replied
    That looks like a bug. I'd post an issue about it on Hengband's issue list. My guess as to why they haven't seen it when they compile for Linux is that SAFE_SETUID_POSIX somehow isn't set there while it is set on cygwin. Commenting out lines 51 to 53 of src/system/h-config.h (i.e. replace

    Code:
      #ifdef _POSIX_SAVED_IDS
        #define SAFE_SETUID_POSIX
      #endif
    with

    Code:
    #if 0
      #ifdef _POSIX_SAVED_IDS
        #define SAFE_SETUID_POSIX
      #endif
    #endif
    ) and recompiling may work around the problem.

    Leave a comment:


  • Compiling Hengband: "fatal error: util.h: No such file or directory"

    When compiling Hengband--the latest from the Hengband repo--in Cygwin, following the instructions for Unix here https://github.com/hengband/hengband.../readme-eng.md , I get an error:

    Code:
    io/uid-checker.cpp:6:10: fatal error: util.h: No such file or directory
        6 | #include "util.h"
    If I comment that include line in uid-checker.cpp out, Hengband compiles with no further errors, but running the generated .exe gives a "setuid(): cannot set permissions correctly!" error.

    There are a lot of files in the Hengband repo ending with "-util.h," but none named just "util.h." Could this be a typo in uid-checker.cpp, or a missing file?

    I'm a noob at this, sorry for the dumb question!
Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎