Skip to content

Many issues when using nmake to compile NetHack with curses interface on Windows #1578

Open

Description

@0xb1aded

When a user follows the documentation path (README → sys/windows/Install.windows → sys/windows/build-nmake.txt) to build NetHack with curses support using nmake, several confusing points and tool bugs are encountered.

  1. fetch.cmd is broken, it does not actually fetch anything, due to cmd's variable expansion rules. To fix this, add setlocal enabledelayedexpansion at the top of fetch.cmd and change %VAR% to !VAR!.
  2. In Makefile.nmake, even with WANT_CURSES=Y, pdcursesmod is never auto-fetched, while Lua is always auto-fetched. Both WANT_CURSES and ADD_CURSES exist in Makefile.nmake, but their usage is confusing. I think they are mistakenly swapped in some places, making it impossible to ever fetch pdcursesmod, so users will always get binary without curses interface.

Are these issues by design, or are they unintended bugs? A reply would be much appreciated. If changes are needed, I can submit a PR cuz I have successfully built a curses-enabled binary on Windows 11.

Activity

  1. nhmall commented on Jun 10, 2026

    @nhmall
    Contributor

    I’ll look into it. I always just use
    nmake git=1
    and I haven’t had any issues with that, so I was not aware of issues with the other approaches. I always get curses included.

    Thanks for reporting.

  2. 0xb1aded commented on Jun 11, 2026

    @0xb1aded
    ContributorAuthor

    I made modifications in my fork to compile a binary with curses interface on Windows successfully. But those changes were my own assumptions, I wasn't sure about the original design intentions of these tools/vars. However under my modification in fix/nmake-auto-fetch-pdcursesmod, there is an additional issue: The first compilation always fails at wintty.c (NMAKE : fatal error U1073: don't know how to make "objpdctxt\x64\pdcclip.o"). Only by executing nmake clean and then nmake package after this error can it succeed. Perhaps my edits and info can help you locate the problem more quickly.

    https://github.com/0x0b1ade/NetHack/tree/fix/fetch.cmd
    https://github.com/0x0b1ade/NetHack/tree/fix/nmake-auto-fetch-pdcursesmod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions