PDA

View Full Version : Getting Visual C++ 2008 Express Edition to compile Angband 3.0.9


Orillian
February 9, 2008, 11:22
Anyone around here familiar with VC++ 2008 Express Edition?

If so what do I need to set up to get this all working. :P I feel like such a nub today. Well I am a nub in all honesty. It's been way to long since I last sat down with a compiler.

For all of you who are gonna complain that I'm using VC...I'm supposed to familiarize myself with it for another project so back off! :P

From what I understand I need to include ALL the .c files in the src/ folder but main-win.c is the only main-*.* file I use. do I still use main.c? I also add all the files from src/win/ as well.

I can add this to an empty Win32 app project. anything else I need to install or configure?

Thanks in advance. I've gleaned what I could searching the forums here, but I'm still fuzzy about what I need to do.

I did try compiling with the above done, but I get an error :

...src\h-basic.h(148) : fatal error C1083: Cannot open include file: 'pwd.h': No such file or directory.

Not sure why, but I do know pwd.h does not exist in the src or any other dir in the source folders. :)

O.

zaimoni
February 9, 2008, 16:56
1) No, use only main-win.c . You only need one main()/WinMain() function.

2) the pwd.h error is because the WINDOWS macro is not being correctly auto-detected in h-config.h . Either pass it as a command-line define, or determine what flag MSVC 2008 is sending that would allow autodetection and send in a patch.

3) If I recall correctly (from ~1995), pay careful attention to MS remove() (which should bother you only in z-file.c). It has a non-POSIX return convention of -1 for failure rather than 0, so the usage of that return value has to be adjusted.

takkaria
February 9, 2008, 18:15
3) If I recall correctly (from ~1995), pay careful attention to MS remove() (which should bother you only in z-file.c). It has a non-POSIX return convention of -1 for failure rather than 0, so the usage of that return value has to be adjusted.

Luckily nowhere in the game actually checks that, so you don't need to worry. I didn't know MS broke POSIX there too, though --ta.

Orillian
February 9, 2008, 21:44
2) the pwd.h error is because the WINDOWS macro is not being correctly auto-detected in h-config.h . Either pass it as a command-line define, or determine what flag MSVC 2008 is sending that would allow autodetection and send in a patch.

ok, I have no idea how to do either of these options you talk about. :P

My knowledge of VC++ is 2 days old. :( the last time I used any compiler it was command line and I was using a text editor for making code changes. :(

I know I'm asking a lot, but any more help you can provide would be great. :)
In the meantime I'll continue reading the documentation and looking online for some info regarding doing either of the above. :P

O.

Pete Mack
February 10, 2008, 06:50
ok, I have no idea how to do either of these options you talk about. :P

My knowledge of VC++ is 2 days old. :( the last time I used any compiler it was command line and I was using a text editor for making code changes. :(

I know I'm asking a lot, but any more help you can provide would be great. :)
In the meantime I'll continue reading the documentation and looking online for some info regarding doing either of the above. :P

O.

You probably don't want to use autoconf/configure--ie no h-config.h--for a
VC build, since it's really intended only for UNIX/POSIX compiles.

You do need to make sure that the appropriate defines are on your command line in the build process. The only way that pwd.h is getting included is if you have one of SET_UID or MACH_O_CARBON defined in the build arguments or in a .h file somewhere. Either of these is very wrong.

To find out which defines you need, read Makefile.win:

-DWINDOWS will WINDOWS in the list of predefined constants in the build options.
You may also need an empty definition for NEAR in readdib.c

Finally, if you can find a user's group or a mentor somewhere, an hour or two of help makes a huge difference.

Orillian
February 10, 2008, 10:23
Ya I've been reading as much as I can! Trying to figure things out. :P I have a couple guys I can pester with questions, just need to wait till Monday for that! :) ty for the tips I'll look around at the defines!

O.