Getting Angband from Github and compiling it

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts

  • Mark
    replied
    Hmm....

    ...actually I already had them in the root folder of the project too, I forgot to mention that.

    However, I do have my exe being created in \Debug. I copy the two dll's there - and I get the same forign-character error as when I copy them to SysWOW64, and if I delete them from there, I get the regular english error message.

    Leave a comment:


  • Nick
    replied
    Originally posted by Mark
    I found libpng12.dll in src\win\dll - not being quite sure what to do I put copies in \src and \src\win. This didn't help. Given the output window referenced other dll's in "C:\windows\SysWOW64" I copied libpng12.dll there too - and this just gave a strange error instead (perhaps the same error but in foreign characters). See attached.

    Any ideas? And thanks to everyone helping get this far!
    I believe you need to copy libpng12.dll and zlib1.dll to the top directory, the one with angband.exe in it.

    Leave a comment:


  • Mark
    replied
    Thanks Nick,

    I took the second option you suggested and the errors are gone. Trying to compile gives a new Windows error. "The program can't start because libpng12.dll is missing from your computer. Try reinstalling the program to fix this problem." (image attached)

    The output window contains:

    Code:
    'Angband15MG.exe' (Win32): Loaded 'D:\Users\mark\Documents\GitHub\angband\build\Debug\Angband15MG.exe'. Symbols loaded.
    'Angband15MG.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
    'Angband15MG.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
    'Angband15MG.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
    The program '[3840] Angband15MG.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'.

    I found libpng12.dll in src\win\dll - not being quite sure what to do I put copies in \src and \src\win. This didn't help. Given the output window referenced other dll's in "C:\windows\SysWOW64" I copied libpng12.dll there too - and this just gave a strange error instead (perhaps the same error but in foreign characters). See attached.

    Any ideas? And thanks to everyone helping get this far!
    Attached Files

    Leave a comment:


  • Nick
    replied
    OK, I don't really know what I'm doing here, but I'll have a guess.

    It looks like the instructions don't include compiling the borg in. So your options to me look like:
    1. Don't include the borg. To do this, I think just commenting out (or deleting) the line
      Code:
      #define ALLOW_BORG
      in src\config.h should work;
    2. Compile the borg in. I suspect adding all the .c and .h files in the src\borg directory (as you did for the src\player etc directories) will do the trick, or at least give a different error.

    Leave a comment:


  • Mark
    replied
    Thanks for your help Blue Baron.

    I made the replacements you suggested and the errors stopped. Weird that the const declaration one line above didn't seem to prevent it anyway

    Code:
    	static const int list_size = 64;
    sits right above
    Code:
    	const char *initial_pronoun;
    	const char *name_list[64];
    	int color_list[64];
    	int damage_list[64];
    (the above snippet already has "list_size" swapped for "64")

    Then I ran into Linker errors, apparently the path and file names I put in the additional dependancies were incorrect. (I put "\src\win\" but needed "\src\win\lib" and I refered to "zlib1.lib", whereas it needed to be "zlib.lib"). Perhaps the Visual Studio help file can be updated. (If I were more confident in my github usage and that these are indeed corrections not artifacts of something I'm doing wrong, I'd make the change myself).

    However (!) I now get new errors:

    Code:
    1>------ Build started: Project: Angband15MG, Configuration: Debug Win32 ------
    1>cmd-misc.obj : error LNK2019: unresolved external symbol _do_cmd_borg referenced in function _do_cmd_try_borg
    1>dungeon.obj : error LNK2001: unresolved external symbol _borg_active
    1>D:\Users\mark\Documents\GitHub\angband\build\Debug\Angband15MG.exe : fatal error LNK1120: 2 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Any ideas how to fix them or if I'm doing something fundamentally wrong in the first instance?

    Something Borgish not updated/supported in the latest win libs?

    Leave a comment:


  • Blue Baron
    replied
    Originally posted by Mark
    1) It mentions nothing about Makefile. I know nothing about Makefile either, so I'm hoping the talk of Makefile on this thread doesn't apply to Win7/VS2013
    yeah, the makefile is typically used when cross compiling on Linux, or when using Cygwin or MSYS.

    Originally posted by Mark
    2) I've done all the steps, but step 6 is unclear to me, perhaps terminology has changed in VS since the steps were written. Step 6 says:

    I'm not sure if I've entered "src\win\zlib1.lib src\win\libpng.lib msimg32.lib winmm.lib " in the correct place, so I ended up entering it in multiple places, see screenshot attached.
    The image is difficult to read, but it looks like the first line of the first image is "additional dependencies", and the last item on that line is "kernel{32 or 64}.lib". If so, that would be the correct line.


    Originally posted by Mark
    When I compile, I get these errors:
    for the first error group (in z-set.c) the compiler is not finding a definition of "ssize_t". I'm not sure where it might be defined, but you should be able to be replace it with "int" on line 53, as that is the return value of the function _set_find.

    for the second group (in monster/mon-lore.c), visual studio does not see list_size as a constant for the array initializations. you should be able to replace "list_size" with "64" on lines 1531, 1532,and 1533, to get it to compile.

    I have not tried it, so I'm not sure if the above is correct, but the above replacements might get it to compile for you.

    Leave a comment:


  • Mark
    replied
    Trying to compile in VS2013, Windows 7

    Hi Guys,

    I'm trying to compile the latest version from github in VS2013, on Windows 7 (SP1, 64-bit).

    I'm trying to follow the steps found in
    \src\win\angband_visual_studio_step_by_step.txt (attached)

    1) It mentions nothing about Makefile. I know nothing about Makefile either, so I'm hoping the talk of Makefile on this thread doesn't apply to Win7/VS2013

    2) I've done all the steps, but step 6 is unclear to me, perhaps terminology has changed in VS since the steps were written. Step 6 says:

    6. In the project settings, in the Link tab, in the Object/library modules
    line, add: "src\win\zlib1.lib src\win\libpng.lib msimg32.lib winmm.lib "
    to the front of the line.
    I'm not sure if I've entered "src\win\zlib1.lib src\win\libpng.lib msimg32.lib winmm.lib " in the correct place, so I ended up entering it in multiple places, see screenshot attached.

    When I compile, I get these errors:

    Code:
    1>------ Build started: Project: Angband15MG, Configuration: Debug Win32 ------
    1>  z-set.c
    1>d:\users\mark\documents\github\angband\build\src\z-set.c(53): error C2065: 'ssize_t' : undeclared identifier
    1>d:\users\mark\documents\github\angband\build\src\z-set.c(53): error C2146: syntax error : missing ';' before identifier 'i'
    1>d:\users\mark\documents\github\angband\build\src\z-set.c(53): error C2065: 'i' : undeclared identifier
    1>d:\users\mark\documents\github\angband\build\src\z-set.c(56): error C2065: 'i' : undeclared identifier
    1>d:\users\mark\documents\github\angband\build\src\z-set.c(57): error C2065: 'i' : undeclared identifier
    1>d:\users\mark\documents\github\angband\build\src\z-set.c(61): error C2065: 'i' : undeclared identifier
    1>  mon-lore.c
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1531): error C2057: expected constant expression
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1531): error C2466: cannot allocate an array of constant size 0
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1531): error C2133: 'name_list' : unknown size
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1532): error C2057: expected constant expression
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1532): error C2466: cannot allocate an array of constant size 0
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1532): error C2133: 'color_list' : unknown size
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1533): error C2057: expected constant expression
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1533): error C2466: cannot allocate an array of constant size 0
    1>d:\users\mark\documents\github\angband\build\src\monster\mon-lore.c(1533): error C2133: 'damage_list' : unknown size
    1>  Generating Code...
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Can anyone offer me any help? Much appreciated if so!
    Attached Files

    Leave a comment:


  • TricksterWolf
    replied
    FINALLY!

    I had to re-import the project. The problem was that I had the src folder listed as the project folder, and I needed to be one level up. Mostly my fault but still a bit of a stumbler given my lack of knowledge of all the details to the folder structure.

    Everything works now. For the record, I had to change the make command and I had to edit z-file.c as described before.

    However, I can run the program from within NetBeans, but not outside it. From outside my IDE it demands cygwin1.dll, which suggests to me that I'm not compiling this properly so it will run under Windows without Cygwin installed.


    UPDATE: The issue seems to be that I'm not using a cross-compiler properly. I'll do some research on the Web until I find the answer. So close and yet so far...

    Leave a comment:


  • TricksterWolf
    replied
    I changed the main directory to be src, but now it's complaining it can't find lib (it's looking for something in lib/apex so I know it's not win/lib). I may need to compare this to my separate ang game that I play to see what is missing.

    Any clues would be handy, if you have them. Thanks!

    UPDATE: If I try to run angband.exe from the directory it's in, it complains about needing a cygwin1.dll. I want this to run through Windows, not Cygwin; I'm only using Cygwin to compile the damned thing. Am I going about this all wrong?

    UPDATE MOAR: I'm starting to suspect that the problem is mkdir related, in which case my workaround for z-file.c was not correct... But again, any advice would be appreciated.
    Last edited by TricksterWolf; June 23, 2013, 22:00.

    Leave a comment:


  • TricksterWolf
    replied
    BUCK YES

    I did it. It actually compiles.

    Here's what I had to change (in z-file.c), apart from what I mentioned earlier wrt the make command.

    1) Commented out the <direct.h> include.

    2) Changed the definition of my_mkdir in WINDOWS to make it identical to the definition used in HAVE_MKDIR || MACH_O_CARBON. In other words, it now calls mkdir(path, perms) instead of mkdir(path) even though WINDOWS is defined.

    This is using NetBeans over Cygwin on Windows 7, for those curious.

    (Now I have to figure out how to run the damn thing, as it is demanding dll's it isn't finding.)

    Leave a comment:


  • TricksterWolf
    replied
    I'm back.

    Trying to compile fresh again. I have angband set up through NetBeans, cloned from a fork of the recent master branch. Clean worked, compile didn't.

    Turns out all I needed to do to get compiling to work was to change the make command from:

    ${MAKE} -f Makefile

    ...to:

    ${MAKE} MINGW=yes -f Makefile.win

    However, I still have one fatal error:

    z-file.c:25:21: fatal error: direct.h: No such file or directory

    That's pretty close to the end of the object files so I'm fairly confident I'll get there eventually; but what is this "direct.h"? It's not part of the INCLUDED_ANGBAND_H list, and it's not in the main directory either.

    Kinda stumped here.

    Leave a comment:


  • Zireael
    replied
    What are the dependencies for Angband? (I'm on Win7)

    Leave a comment:


  • TJS
    replied
    Well that worked a treat thanks!

    I should have figured that out ages ago.

    Leave a comment:


  • Mikko Lehtinen
    replied
    Originally posted by TJS
    Is it possible to point directly to the mingw32-make.exe somehow in the command line?
    Yes.

    Code:
    C:\path\to\mingw\bin\mingw32-make -f Makefile.win MINGW=YES

    Leave a comment:


  • TJS
    replied
    Originally posted by Mikko Lehtinen
    Yes, the normal Windows command prompt. (And in the angband/src directory.) You need to open a new command prompt window after setting the PATH.

    Check your mingw/bin folder: does it have the file mingw32-make.exe?
    Yes it has the mingw32-make.exe file (along with a load of other ones).

    When I installed MSYS it said I needed to rename the make.exe as the mingw32-make.exe, but when I looked in the bin folder there was no make.exe and the mingw32-make.exe was already there.

    Is it possible to point directly to the mingw32-make.exe somehow in the command line?

    Leave a comment:

Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎