Many people want to create their own versions of Angband and its variants. If you
can't compile a new variant for your system you often have to wait some time until
some kind soul makes a pre-compiled version available. You wait and wait, and read
about all the great features of the new version in
And when the pre-compiled version finally arrives the next version is already
I'll try to give a step-by-step guide for compiling Angband on the various platforms and compilers.
I recommend that you use the standard Angband source code for your first attempt. The variants often need some tweaking with the configuration. I'll try to cover them in a later update of this page.
If you have compiled Angband and want to share your knowledge with others, send me an e-mail.
Unpack these two (later versions of Winzip can handle .tar.gz) to c:\, with the 'keep folder names' option on. Copy all the files from "c:\ext-win\src" to "c:\angband-283\src" and move the directory "c:\ext-win\lib\xtra" to be "c:\angband-283\lib\xtra". Finally, copy "c:\ext-win\Angband.ini" to "c:\angband-283\Angband.ini".
Now fire up VC++ (I'm assuming 4.0, but it's pretty similar for 5.0).
Select File->New->Project Workspace. Choose Application, set the Name to angband, and the Directory to "c:\angband-283". Choose Insert->Files Into Project. Change directory to src, shift-select everything from the top down to main.c and click Ok. Do the same again and select main-win.c. Do the same again and select everything from melee.c down. Now choose Build->Build Angband.exe.
It should compile everything fine, but complain about PlaySound when it tries to link it. We sort that out by Build->Settings, choose the Link tab (you might have to scroll the tab listing to the right, it's the one after C/C++) and add 'winmm.lib' to the end of the long list of filenames in Object/Library modules. Click Ok, then do Build->Build Angband.exe again. That should have built fine now.
Go to Explorer, and copy "c:\angband-283\Debug\Angband.exe" to "c:\angband-283\Angband.exe". Open "c:\angband-283\Angband.ini" in NotePad and change the LibPath line to "LibPath=c:\angband-283\lib".
We are almost ready, but we have to create a few missing directories. Create "c:\angband-283\lib\info", "\bone", "\apex", "\save" and "\data".
Then run Angband by double-clicking on it. You may find that the initial screen come up totally blank, but don't panic, choose Window->Font->Term-0 and select one of the font files, and it should all be ok.
I have occasionally had a problem where Angband could not save files. Try this out by creating a new character and using File->Save to try and save him once you are in the town. If it says 'Saving game... failed!' then you have the problem.
The solution is to patch the code slightly.
Go to line 564 of the source file 'util.c' (You can open it using the file
browser, normally the window on the left of the VC++ screen.
Change the line so that it reads exactly:
return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY,_S_IWRITE));
Be careful with the brackets!
The go to near the top of the file, around line 14, just under the
line, and add a line:
Now choose Build->Build Angband.exe again, wait for it to build, then move Angband.exe from "c:\angband-283\Debug" to "c:\angband-283"
Try running it again, and you should be able to save just fine. Note that before running you should remove any files from "c:\angband-283\save" and "\apex", as otherwise you would not be able to save a character with the same name as you tried earlier, or have scores in the high score table.
If you want to use graphical tiles, please replace the 'lib\xtra\graf\8x8.bmp' file with a version from another archive. The colors are somehow screwed up in the standard distribution.
Unpack these two (later versions of Winzip can handle .tar.gz) to c:\, with the 'keep folder names' option on. Copy all the files from "c:\ext-win\src" to "c:\angband-283\src" and move the directory "c:\ext-win\lib\xtra" to be "c:\angband-283\lib\xtra".
Now fire up BC5.
Create a new project with the target wizard, choosing "application", Win32 platform and Gui target model, and angband as the target name.
Set compile options (Messages) to 255 warnings so it will make :)
Add the c:\angband-283\src (or wherever you unpacked the files) to the include directories so bc5 can find the header files.
Set the output dir to c:\angband-283 (or a dir of your choice)
Remove the default nodes in the ide window and add all the .c files in src with the exception of the "MAIN" variations, just add main-win.c for those.
Add the resource node angband.rc
Edit h-config.h to uncomment the #define windows statement.
Add to util.c line around line 12 ..
#include <sys/stat.h>and around line 560,
change the line
return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY));to this:
return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY,S_IWRITE));Note the similarity to the VC++ directions, the syntax is just slightly different for Borland.
Create these directories if they are missing: "c:\angband-283\lib\info", "\bone", "\apex", "\save" and "\data".
Now run or build all and you should get a target exe named "angband.exe" placed neatly in the dir it should be executed from.
Run angband there if you like, or copy the exe, the angband.ini and the lib directory to a place of your choosing, but remember to edit angband.ini to reflect the proper library path.
;c:\angband\src\lua" (modify the path to match your own Angband source installation of course) to the include path. On the 'Linker settings' page change the output filename to "C:\angband" (again - use you own Angband path). Then type "
winmm.lib" in the 'Additional files to be included in the link' field. In the 'Debugger settings' you should change the start directory to "C:\angband" (or again use your own path to the Angband directory). The 'Executable to start' should be "C:\angband\angband.exe" (did I already mention change it to your path if necessary?). The settings part is now finished. When asked if you want to "Open ... files?" simply say no.
Available at: http://www2.thecia.net/users/takemoto/angcompile.htmlPlease note that the guide is a bit old and still refers to the "export.andrew.cmu.edu" FTP server that has been replaced by a new FTP server server.
Also note that some of the *.txt files have spaces at the end of lines, and these need to be left alone - some conversion utilities (Port, by default, being one) try to be clever and strip these off. Make sure your chosen utility doesn't do this, or alternatively don't convert the *.txt files - Angband is quite happy with either format, but it saves a few bytes to strip them.
Get the Amiga specific files. Copy 'main-ami.c', 'sound-ami.c', 'sound-ami.h', 'scoptions' and 'smakefile' into the 'src' directory.
Now you need to change the directory structure. The sources tend to come looking like this:
lib (dir) apex (dir) bone (dir) . . etc. src (dir)
However, the Amiga versions have traditionally used a slightly different format:
apex (dir) bone (dir) save (dir) . . src (dir)So it's a good idea to move the contents of the lib directory to the root directory, and delete the (now empty) 'lib'. Finally, you should customise the main-ami.c file to your requirements. The main-ami.c file provided can work with three versions of Angband; 281, 282 and 283. Any Angband versions previous to this are not supported; however, as far as I know only JAngband uses older Ang code. Set the appropriate options as documented in the code. It's also a good idea to set the 'VERSION' and 'VERPATH' defines at the top of the file.
You're now ready to compile, so type 'cd src', then 'smake'. Compilation should now have started - be patient here, especially with a slow machine. It's a good idea to have optimisation switched off for the first go, as an optimised compile can take ages. Expect times of roughly 10 minutes on an 060/50, over an hour on an 040/25.
After a few minutes staring at a grey screen, you should end up with an 'Angband' executable. Now assign 'Angband:' to the parent directory, and check that your compiled program works.
Once you're satisfied everything works, you ought to recompile Angband with optimisation turned on. So type 'scopts' and flip the 'NoOptimise' gadget to 'Optimise', save and exit. Then 'smake clean', followed by 'smake'. This will take a lot longer; roughly 1.5 hours on an 040/25.
|© 1997/98 by Robert Rühlmann, email@example.com|