Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old February 9, 2008, 11:22   #1
Orillian
Scout
 
Join Date: Dec 2007
Age: 43
Posts: 37
Orillian is on a distinguished road
Getting Visual C++ 2008 Express Edition to compile Angband 3.0.9

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.
Orillian is offline   Reply With Quote
Old February 9, 2008, 16:56   #2
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
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.
zaimoni is offline   Reply With Quote
Old February 9, 2008, 18:15   #3
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,936
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by zaimoni View Post
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.
takkaria is offline   Reply With Quote
Old February 9, 2008, 21:44   #4
Orillian
Scout
 
Join Date: Dec 2007
Age: 43
Posts: 37
Orillian is on a distinguished road
Quote:
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.
Orillian is offline   Reply With Quote
Old February 10, 2008, 06:50   #5
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,425
Donated: $40
Pete Mack is on a distinguished road
Quote:
Originally Posted by Orillian View Post
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.
Pete Mack is offline   Reply With Quote
Old February 10, 2008, 10:23   #6
Orillian
Scout
 
Join Date: Dec 2007
Age: 43
Posts: 37
Orillian is on a distinguished road
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.
Orillian is offline   Reply With Quote
Reply


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
Compile failure for 3.0.9 on Mac OS X 10.4.10 TreeFrog Vanilla 4 November 8, 2007 15:58


All times are GMT +1. The time now is 12:27.


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