| name | description |
|---|---|
| build_linux_client | Instructions for building the ASCII Linux client on Ubuntu/WSL and configuring remote debugging with Visual Studio Code. |
👉 This skill provides instructions for compiling the legacy ASCII console version of GnollHack for Linux, and how to debug it using Visual Studio Code and WSL.
🐧 Building on Ubuntu/WSL
1. Prerequisites
- Ensure
build-essential,bison,flex, andlibncurses(libncurses5-dev,libncursesw5-dev) are installed on your Linux/WSL instance. - Clone the GnollHack repository.
2. Configure the Build
- Make the setup script executable:
sudo chmod a+rx ./sys/unix/setup.sh - Run the setup script to generate the
Makefilein the top-level directory:- For a standard debug build:
sudo ./sys/unix/setup.sh ./sys/unix/hints/linux-debug - For a public server build (with common xlogfile):
sudo ./sys/unix/setup.sh ./sys/unix/hints/linux-gnh-debug
- For a standard debug build:
3. Compile
- Run
sudo make install -B. This will compile GnollHack and install it to the/gnhdirectory. - Grant permissions to the install directory:
cd /gnhandsudo chmod -R a+rw *. - Run the game:
./gnollhack
🐛 Debugging with Visual Studio Code
1. VS Code Setup
- Install Visual Studio Code on Windows.
- Install the WSL extension and the C/C++ extension.
- In WSL, run
codeto install the VS Code server.
2. WSL Root Configuration
Debugging typically requires root permissions to attach to the process.
- In WSL, set a root password:
sudo -ithenpasswd. - Open a Windows Command Prompt and set the default WSL user to root:
ubuntu2004 config --default-user root(adjust theubuntucommand to match your installed version).
3. Debugging Session
- Open VS Code and connect to the remote GnollHack folder in WSL.
- Ensure the C/C++ extension is installed on the remote WSL (root) server.
- Configure your
launch.jsonto point to/gnh/gnollhackor the output executable. - Set breakpoints in the C code and start the debugging session.