Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old December 10, 2008, 17:28   #1
Altefcat
Rookie
 
Join Date: Sep 2008
Posts: 11
Altefcat is on a distinguished road
Post Compiling Z+Angband under Windows

Hello,

Before I start to scratch my hair off my head, I thought I would better ask here first if anyone wise geek could give me clues for compiling Z+Angband under Windows.

Especially, what compilator and what makefile file should do the best work ?

I've tried using gnuwin with makefile.std (following some Andrew Doull advices), but with no success.

Edit: thanks to Mango Juice, here is the howto.
  1. Install lcc from there: http://www.q-software-solutions.de/downloaders
  2. Get Z+Angband source files from there: http://tinyurl.com/5pq2bd and extract them to a folder
  3. Copy the file lua.h from the src\lua folder to the src folder
  4. Extract the file make.bat.txt attached to this post to the src folder and rename it to make.bat
  5. Launch a command prompt, move to the src folder and run make.bat
Attached Files
File Type: txt make.bat.txt (431 Bytes, 310 views)

Last edited by Altefcat; December 11, 2008 at 09:56.
Altefcat is offline   Reply With Quote
Old December 10, 2008, 18:18   #2
Mangojuice
Z+Angband Maintainer
 
Join Date: Jun 2008
Posts: 318
Mangojuice is on a distinguished road
Quote:
Originally Posted by Altefcat View Post
Hello,

Before I start to scratch my hair off my head, I thought I would better ask here first if anyone wise geek could give me clues for compiling Z+Angband under Windows.

Especially, what compilator and what makefile file should do the best work ?

I've tried using gnuwin with makefile.std (following some Andrew Doull advices), but with no success.
I myself use lcc; in the source package, in the \src directory, is a Makefile; that is the one to use. Unfortunately, there's one thing it doesn't do for you: the lua .c files (like l-player.c) have to be made from the .pkg files, using the "tolua" program which also has to be compiled. I'm attaching a .bat file to make the tolua program, which assumes you are using lcc and that it is installed in C:\lcc. Run that from the \src directory (enter "tolua_make" at a command prompt). After that you have to do (from the \src directory)

lua\tolua.exe -o l-spell.c l-spell.pkg

Do this for each .pkg file. You can then do "make install_game" in the \src directory to make the executable. Hopefully that will work for you.
__________________
-----------------------------------------
Z+Angband: A Zangband evolution
http://tinyurl.com/5pq2bd
Mangojuice is offline   Reply With Quote
Old December 10, 2008, 18:23   #3
Mangojuice
Z+Angband Maintainer
 
Join Date: Jun 2008
Posts: 318
Mangojuice is on a distinguished road
Oops, forgot to attach the file. Here it is. Download it to your \src directory and then do

Code:
move tolua_make.txt tolua_make.bat
tolua_make
(I had to upload it as a .txt file because of the forum rules.)
Attached Files
File Type: txt tolua_make.txt (1.5 KB, 277 views)
__________________
-----------------------------------------
Z+Angband: A Zangband evolution
http://tinyurl.com/5pq2bd
Mangojuice is offline   Reply With Quote
Old December 10, 2008, 21:52   #4
Altefcat
Rookie
 
Join Date: Sep 2008
Posts: 11
Altefcat is on a distinguished road
Ok thank you for your reply. The tolua_make.bat file was already in the lua folder. But that's not working; first I get some warnings with tolua_make.bat, I don't know if that matters a lot:

Code:
Warning lapi.c: 115  Statement has no effect
0 errors, 1 warning
Warning liolib.c: 313  indexing array 122[512] out of bounds (512)
0 errors, 1 warning
Error lobject.c: 21  compiler error in defconst--Constant not recognized of type Value
Warning lparser.c: 399  Statement has no effect
0 errors, 1 warning
Warning lstrlib.c: 56  indexing array 32[512] out of bounds (512)
Warning lstrlib.c: 69  indexing array 45[512] out of bounds (512)
Warning lstrlib.c: 105  indexing array 78[512] out of bounds (512)
Warning lstrlib.c: 497  indexing array 432[512] out of bounds (512)
Warning lstrlib.c: 540  indexing array 486[512] out of bounds (512)
Warning lstrlib.c: 542  indexing array 492[512] out of bounds (512)
0 errors, 6 warnings
Warning lzio.c: 21  Statement has no effect
0 errors, 1 warning
Warning tolualua.c: 16  Statement has no effect
Warning tolualua.c: 2976  Statement has no effect
0 errors, 2 warnings
Warning tolua_bd.c: 24  Statement has no effect
0 errors, 1 warning
Warning tolua_gp.c: 107  Statement has no effect
0 errors, 1 warning
Then when running the make command, I have this:

Code:
    C:\lcc\bin\lcc.exe -O -g l-monst.c
cpp: c:\jeux\zplusangband_031beta_src\src\lua\tolua.h:28 l-monst.c:6 Could not find include file "lua.h"
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 32  syntax error; found `*' expecting ')'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 32  skipping `*' `L'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 32  extraneous old-style parameter list
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 33  syntax error; found `*' expecting ')'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 33  skipping `*' `L' `,'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 33  Syntax error; missing semicolon before  `)'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 33  skipping `)'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  syntax error; found `*' expecting ')'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  skipping `*' `L' `,'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  extraneous old-style parameter list
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  Syntax error; missing semicolon before  `int'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  missing identifier
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  Syntax error; missing semicolon before  `int'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  Syntax error; missing semicolon before  `)'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 34  skipping `)'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 35  syntax error; found `*' expecting ')'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 35  skipping `*' `L' `,'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 35  extraneous old-style parameter list
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 35  Syntax error; missing semicolon before  `int'
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 35  missing identifier
Error c:\jeux\zplusangband_031beta_src\src\l-monst.c: lua\tolua.h: 35  too many errors
make.exe: Error code 1
I can modify l-monst.c to include properly lua.h, but then I get some other errors. Do you have an idea what I've done wrong?

Please find attached a batch file I've done to try to automize the whole make process.

By the way I've installed lcc from the first link of that page.
Attached Files
File Type: txt make.bat.txt (150 Bytes, 228 views)
Altefcat is offline   Reply With Quote
Old December 10, 2008, 22:17   #5
Mangojuice
Z+Angband Maintainer
 
Join Date: Jun 2008
Posts: 318
Mangojuice is on a distinguished road
Quote:
Originally Posted by Altefcat View Post
Ok thank you for your reply. The tolua_make.bat file was already in the lua folder. But that's not working; first I get some warnings with tolua_make.bat, I don't know if that matters a lot:
That's probably okay.

Quote:
Then when running the make command, I have this:

I can modify l-monst.c to include properly lua.h, but then I get some other errors. Do you have an idea what I've done wrong?
My instinct is that lcc is somehow not looking in the right place for the .h file. It probably expects the lua.h file to be in your src directory, so maybe copy it into there. Then you won't have to repeat this fix for all the lua wrapper files. But let me know if you get other problems.
__________________
-----------------------------------------
Z+Angband: A Zangband evolution
http://tinyurl.com/5pq2bd
Mangojuice is offline   Reply With Quote
Old December 10, 2008, 22:53   #6
Altefcat
Rookie
 
Join Date: Sep 2008
Posts: 11
Altefcat is on a distinguished road
Copying lua.h to the source dir solved the first error, but then I got:

Code:
    C:\lcc\bin\lcc.exe -O -g l-monst.c
Error l-monst.c: 9  Syntax error; missing semicolon before  `-'
Error l-monst.c: 9  unrecognized declaration
Warning l-monst.c: 9  no type specified. Defaulting to int
Error l-monst.c: 10  redefinition of 'tolua_l'
Error l-monst.c: 9  Previous definition of 'tolua_l' here
Error l-monst.c: 10  Syntax error; missing semicolon before  `-'
Error l-monst.c: 10  unrecognized declaration
Warning l-monst.c: 10  no type specified. Defaulting to int
Warning l-monst.c: 17  Statement has no effect
Error l-monst.c: 22  Syntax error; missing semicolon before  `-'
Error l-monst.c: 22  unrecognized declaration
Warning l-monst.c: 22  no type specified. Defaulting to int
Error l-monst.c: 32  Syntax error; missing semicolon before  `-'
Error l-monst.c: 32  unrecognized declaration
Warning l-monst.c: 32  no type specified. Defaulting to int
Error l-monst.c: 33  redefinition of function 'monst_monster_race_flags'
Error l-monst.c: 22  Previous definition of 'monst_monster_race_flags' here
Error l-monst.c: 42  Syntax error; missing semicolon before  `-'
Error l-monst.c: 42  unrecognized declaration
Warning l-monst.c: 42  no type specified. Defaulting to int
Error l-monst.c: 50  Syntax error; missing semicolon before  `-'
Error l-monst.c: 50  unrecognized declaration
Warning l-monst.c: 50  no type specified. Defaulting to int
Error l-monst.c: 51  redefinition of function 'monst_monster_race_d_char'
Error l-monst.c: 42  Previous definition of 'monst_monster_race_d_char' here
Error l-monst.c: 60  Syntax error; missing semicolon before  `-'
Error l-monst.c: 60  unrecognized declaration
Warning l-monst.c: 60  no type specified. Defaulting to int
Error l-monst.c: 68  too many errors
c:\lcc\bin\make.exe: Error code 1
Even after copying every lua\*.h to the src dir, I get the same error.

Maybe it's because of a different lcc version?

I have:

Code:
C:\Jeux\ZPlusAngband_031beta_src\src>lcc.exe -v
Logiciels/Informatique lcc-win32 version 3.8. Compilation date: Dec  2 2008 14:31:08
which is rather young...
Altefcat is offline   Reply With Quote
Old December 11, 2008, 03:18   #7
Mangojuice
Z+Angband Maintainer
 
Join Date: Jun 2008
Posts: 318
Mangojuice is on a distinguished road
Quote:
Originally Posted by Altefcat View Post
Copying lua.h to the source dir solved the first error, but then I got:

Code:
    C:\lcc\bin\lcc.exe -O -g l-monst.c
Error l-monst.c: 9  Syntax error; missing semicolon before  `-'
Error l-monst.c: 9  unrecognized declaration
Warning l-monst.c: 9  no type specified. Defaulting to int
Error l-monst.c: 10  redefinition of 'tolua_l'
Error l-monst.c: 9  Previous definition of 'tolua_l' here
Error l-monst.c: 10  Syntax error; missing semicolon before  `-'
Error l-monst.c: 10  unrecognized declaration
Warning l-monst.c: 10  no type specified. Defaulting to int
Warning l-monst.c: 17  Statement has no effect
Error l-monst.c: 22  Syntax error; missing semicolon before  `-'
Error l-monst.c: 22  unrecognized declaration
Warning l-monst.c: 22  no type specified. Defaulting to int
Error l-monst.c: 32  Syntax error; missing semicolon before  `-'
Error l-monst.c: 32  unrecognized declaration
Warning l-monst.c: 32  no type specified. Defaulting to int
Error l-monst.c: 33  redefinition of function 'monst_monster_race_flags'
Error l-monst.c: 22  Previous definition of 'monst_monster_race_flags' here
Error l-monst.c: 42  Syntax error; missing semicolon before  `-'
Error l-monst.c: 42  unrecognized declaration
Warning l-monst.c: 42  no type specified. Defaulting to int
Error l-monst.c: 50  Syntax error; missing semicolon before  `-'
Error l-monst.c: 50  unrecognized declaration
Warning l-monst.c: 50  no type specified. Defaulting to int
Error l-monst.c: 51  redefinition of function 'monst_monster_race_d_char'
Error l-monst.c: 42  Previous definition of 'monst_monster_race_d_char' here
Error l-monst.c: 60  Syntax error; missing semicolon before  `-'
Error l-monst.c: 60  unrecognized declaration
Warning l-monst.c: 60  no type specified. Defaulting to int
Error l-monst.c: 68  too many errors
c:\lcc\bin\make.exe: Error code 1
Even after copying every lua\*.h to the src dir, I get the same error.

Maybe it's because of a different lcc version?

I have:

Code:
C:\Jeux\ZPlusAngband_031beta_src\src>lcc.exe -v
Logiciels/Informatique lcc-win32 version 3.8. Compilation date: Dec  2 2008 14:31:08
which is rather young...
I think I've got it. I had the wrong instructions before: do

"lua\tolua.exe -n monst -o l-monst.c l-monst.pkg"

to make l-monst.c; the "-n monst" makes the base name for all the functions "monst" instead of "l-monst", which confuses the compiler badly because it thinks the '-' is subtraction.
__________________
-----------------------------------------
Z+Angband: A Zangband evolution
http://tinyurl.com/5pq2bd
Mangojuice is offline   Reply With Quote
Old December 11, 2008, 09:59   #8
Altefcat
Rookie
 
Join Date: Sep 2008
Posts: 11
Altefcat is on a distinguished road
Quote:
Originally Posted by Mangojuice View Post
I think I've got it. I had the wrong instructions before: do

"lua\tolua.exe -n monst -o l-monst.c l-monst.pkg"

to make l-monst.c; the "-n monst" makes the base name for all the functions "monst" instead of "l-monst", which confuses the compiler badly because it thinks the '-' is subtraction.
That made it, thank you very much!

I've updated the first post to give the full procedure. Is it possible to remove the '?' in the title?
Altefcat is offline   Reply With Quote
Old December 11, 2008, 10:44   #9
pav
Administrator
 
pav's Avatar
 
Join Date: Apr 2007
Location: Prague, Czech republic
Age: 38
Posts: 777
pav is on a distinguished road
Send a message via ICQ to pav
Quote:
Originally Posted by Altefcat View Post
I've updated the first post to give the full procedure. Is it possible to remove the '?' in the title?
Sure, done.
__________________
See the elves and everything! http://angband.oook.cz
pav 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
Getting Unangband/Angband from SVN and Compiling on Windows andrewdoull Development 133 April 7, 2011 15:28
Angband Borg 3.0.9 and windows Zappa Vanilla 38 October 27, 2010 21:31
graphic problems Windows XP Angband ditoLoco Vanilla 5 May 8, 2009 07:33
Windows Compiling and Makefiles APWhite Vanilla 11 August 22, 2007 22:22
Trouble compiling angband 3.0.9 on linux RastaRuedi Vanilla 2 August 1, 2007 18:28


All times are GMT +1. The time now is 13:34.


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