Go Back   Angband Forums > Angband > Development

Thread Tools Display Modes
Old October 29, 2018, 16:21   #1
Join Date: Jun 2009
Posts: 3
Once is on a distinguished road
Compiling a pure console version on Windows with MingW

Dear all,

I love playing angband but was not satisfied with the look of it on Windows. The fonts used in the official binary are too large or too small for my taste, and I wish I could play directly in the console, like I do on linux machines.

However, it is still possible to compile the latest version of Angband (4.1.3) to run in a Windows console, with only very minor changes to the code. I share these below for anyone who experienced the same issues.

Step 0: You need a compiler... I assume that you have installed MingW and the base development libraries. If not, there are posts explaiing how to fo this in this forum.

Step 1: Make sure you have the *ncurses* library installed. Contrary to what is written in the Makefile, pdcurses will not be sufficient. You need term.h, which only comes with ncurses.
To do that, type mingw-get in a console, then select and install libncurses-dev

Move to the angband/src folder

Step 2: Modify lines 50 and 51 with the correct install path of ncurses
PDCURSES_INC = C:/MinGW/include/ncurses
PDCURSES_LIB = C:/MinGW/lib/libncurses.a
Yes, the keyword says PDCURSES, but it doesn't matter.

Step 3: If you try to compile the console version right now it will fail because a few headers do not exist on Windows. These are the locale stuff, and the sound. We do not need either for this version so we can comment these problems out.

In main.c
comment out line 38 "#include "langinfo.h"

lines 467-473
Comment out the full section "if (setlocale(LC_CTYPE, "")) {..."
In sound-core.c, line 62
Comment out the line "	{ "win", "Windows sound module", init_sound_win }, "
In main-gcu.c replace line 66
"_stdcall void Sleep(int);" with "void Sleep(int);"
That's it !

Step 4: Compile
mingw32-make -f CONSOLE=yes MINGW=yes
This works perfectly on my machine. I can now play angband in the windows cmd.exe, or with the wonderful ConEmu, which is my usual console emulator.

Edit: updated instructions:
The last change should be done in main-gcu.c and not main.c
Line 38 should also be commented out in main.c (langinfo.h does not exist on windows)

Last edited by Once; October 29, 2018 at 19:43.
Once is offline   Reply With Quote
Old October 29, 2018, 19:36   #2
Vanilla maintainer
Nick's Avatar
Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,355
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Thanks for that. I've filed a change to add those to the official compiling instructions.
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old October 29, 2018, 19:44   #3
Join Date: Jun 2009
Posts: 3
Once is on a distinguished road
Thanks !

I noticed I had forgotten one instruction so I edited the first post.
Once is offline   Reply With Quote
Old October 30, 2018, 08:22   #4
PowerWyrm's Avatar
Join Date: Apr 2008
Posts: 2,926
PowerWyrm is on a distinguished road
Lovely. Does this work with Necklace of the Eye?
PWMAngband variant maintainer - check (or to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 3, 2018, 22:12   #5
Join Date: Jun 2009
Posts: 3
Once is on a distinguished road
Originally Posted by PowerWyrm View Post
Lovely. Does this work with Necklace of the Eye?
I guess it should, but I have never used NotEye.
Once is offline   Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling 4.1 on Windows 10 fizzix Development 3 May 3, 2018 02:25
Build failures on stripped Windows (mingw) Pete Mack Vanilla 1 April 10, 2013 08:08
Compiling V for Windows Therem Harth Vanilla 8 September 4, 2011 23:36
Compiling a "Windows Console" version Dean Anderson Development 34 December 3, 2010 22:00
Love The New Windows Console Patch Malak Darkhunter Vanilla 0 December 8, 2007 18:50

All times are GMT +1. The time now is 03:36.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.