Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   Compiling a pure console version on Windows with MingW (http://angband.oook.cz/forum/showthread.php?t=9160)

Once October 29, 2018 17:21

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 Makefile.win lines 50 and 51 with the correct install path of ncurses
Code:

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.

Code:

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

lines 467-473
Comment out the full section "if (setlocale(LC_CTYPE, "")) {..."

Code:

In sound-core.c, line 62
Comment out the line "        { "win", "Windows sound module", init_sound_win }, "

Code:

In main-gcu.c replace line 66
"_stdcall void Sleep(int);" with "void Sleep(int);"

That's it !

Step 4: Compile
Code:

mingw32-make -f Makefile.win 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.

https://i.imgur.com/9VXsJc4.jpg

https://i.imgur.com/qOsBQQa.jpg

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)

Nick October 29, 2018 20:36

Thanks for that. I've filed a change to add those to the official compiling instructions.

Once October 29, 2018 20:44

Thanks !

I noticed I had forgotten one instruction so I edited the first post.

PowerWyrm October 30, 2018 09:22

Lovely. Does this work with Necklace of the Eye?

Once November 3, 2018 23:12

Quote:

Originally Posted by PowerWyrm (Post 133981)
Lovely. Does this work with Necklace of the Eye?

I guess it should, but I have never used NotEye.


All times are GMT +1. The time now is 04:19.

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