![]() |
#1 |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Windows Compiling and Makefiles
So you other Windows users, what are you using for compiling and debugging?
I have used Borlands freecommandlinetools for years. It is nice that there is a makefile.bcc included in the old versions of the game. I see now that 308 is out there is no makefile for Borland. What are we to use for a compiler and / or command line makefiles? I also have Visual Studio 2005 but I have only used for PDA applications and have never been able to get it to understand how to use the angband code (so Solution or Project files). |
![]() |
![]() |
![]() |
#2 | |
Rookie
Join Date: Jul 2007
Posts: 18
![]() |
![]() Quote:
I believe the canonical Angband build system uses gcc. Directions for building under cygwin or with DevC++ are in the development wiki. It built for me pretty straightforwardly using this command line from the angband/src directory in cygwin: MINGW=yes make -f Makefile.win Right now, personally, I'm using VS2005 Express to take advantage of the debugging environment. To use VS2005, you need to have the Windows SDK installed as well. Create an empty Windows Application solution, then add all of the Angband src/*.c and src/win/*.c files, as well as the .rc and .ico files. Make sure that the symbol WINDOWS is defined as a compiler command-line option. In order for the resource compiler to find the .ico file at build time, you'll have to add the .ico file location to the include path. To use sound, you will need to add Winmm.lib as an additional library as well. (To build without sound support, comment out the line #define USE_SOUND in config.h.) You can also be fancy about a post-build event in order to copy the .exe to a useable spot so you can just double-click launch it and it will find the lib/ dir properly. -- ctate Last edited by ctate; July 29, 2007 at 04:40. |
|
![]() |
![]() |
![]() |
#3 |
Rookie
Join Date: Jul 2007
Posts: 18
![]() |
Non-cygwin Windows makefile added
Okay, I just added a makefile to the V trunk for building the Windows version directly with Microsoft's NMAKE and MSVC toolchain, in a regular cmd.exe shell window. You go to the src/ subdirectory and type
Code:
NMAKE /F Makefile.nmake Code:
NMAKE /F Makefile.nmake RELEASE=1 Of course you'll need to have the Windows SDK installed and configured for command-line use, as well as the MSVC command-line toolchain. There's a batch file provided in the Visual Studio installation that configures the build environment for you, or you can set all the appropriate environment variables by hand. |
![]() |
![]() |
![]() |
#4 | |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Quote:
I am pretty sure that SDK is installed. I got it most of the way with your description above: I do not see where I can add the ICO file pathway. I added the pathway somewhere, but it did not find the file (eventhough it is present in the solution explorer). I copied the ICO file to the working directory and it found it fine. I was not able to get it to find the winmm.lib file. It is on my drive and under the Project->Preference->Common Properties->References->Reference Search Path, I added the location of the Winmm.lib file, but it still cant find it. As far as adding the commandline option WINDOWS, I am not sure I know where to do this. I added it toProject->Preference->Configuration Properties->Debugging->command arguments. I hope this is the right place. If you could verify this for me, I would greatly appreciate it. I need to use VS2005 in order to debug some Borg graphics issues. The BCC compiler/debugger won't work. The symbols table is too large to load in TD32.exe. It keeps pooping out so I can't effectively debug the angband borg. I thought it might be the Lua issues in 3.0.6. Maybe when I get the borg updated for 308/309, the symbols table will be smaller and I might be able to load it up. Andrew |
|
![]() |
![]() |
![]() |
#5 | |
Rookie
Join Date: Jul 2007
Posts: 18
![]() |
Quote:
I can jot up more detailed instructions on how exactly I set up my VS2005 solution file, but that's at home so I don't have access right now. |
|
![]() |
![]() |
![]() |
#6 | |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Quote:
I ran into a few problems though. This was my trail: 1. Download and unzip the src files. 2. Download and unzip the \lib files 3. Get you makefile.nmake 4. In a cmd shell prompt typed Nmake /F makefile.nmake I am able to get a nice compile and and EXE file using your method above, but the file doesn't do anything. The command prompt advances to the next line so I could do something else there if I needed to, but Angband does not run. If the \lib file is renamed or deleted, I get an angband popup error to that effect. But there is no Angband window, or anything. Its like it is failing at creating the interface. So yours works ok? [edit] This problem only seems to exist on my laptop. If I copy the exe file to my desktop, then it seems to work, though slowly. I must have missed a config option or something. I compiled it straight out of the box, no edits or anything. Any thoughts? Last edited by APWhite; August 6, 2007 at 20:38. |
|
![]() |
![]() |
![]() |
#7 | |
Rookie
Join Date: Jul 2007
Posts: 18
![]() |
Quote:
Running slowly is because it's a debug build. If you do a release build it'll be much snappier. Weird. What happens if you try to run it under the VS debugger on the laptop? Maybe set a bunch of init-time breakpoints and see what is happening... -- ctate |
|
![]() |
![]() |
![]() |
#8 | |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Quote:
I have compiled the file in VS in debug mode (F5) and it says its "running" but it is not going anywhere. I guess I need to stick in some breakpoints and see how far it is getting. It seems like it is failing to draw the screen. My laptop is just a normal everyday Toshiba. Everything else on it works fine. |
|
![]() |
![]() |
![]() |
#9 | |
Rookie
Join Date: Jul 2007
Posts: 18
![]() |
Quote:
If you open up the source files you should be able to set breakpoints etc while running this way. Good luck! -- ctate |
|
![]() |
![]() |
![]() |
#10 | |
Adept
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
![]() |
Quote:
Problems may arise with the screensaver though. That routine is called in the screensaver mode. Note that the SendMessage() works fine for my laptop in version 306. Thanks for your help. I was opening angband.exe as a file instead of a project and it was messing me up. If you find some time, I would like to get the full solution up so that I dont need to switch back to the cmd line in order to compile. But it is not too big of a deal;for years, I have used borlands to compile, so I am in the habit of doing so. Andrew |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting Unangband/Angband from SVN and Compiling on Windows | andrewdoull | Development | 133 | April 7, 2011 14:28 |