Getting Unangband/Angband from SVN and Compiling on Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MKula
    Apprentice
    • Feb 2008
    • 70

    Checked and double checked, and unfortunately no luck. Oh well. Thank you very much for your help, anyway. It's very much appreciated. I'll keep trying and hopefully one of these days I'll get it work.

    EDIT: It is SO OBVIOUS that I'm not a coder; I finally got it to work. The moral of the story? I needed to RE-build the project (not just build) whenever I made a change.
    *sigh...*
    Again, thanks for your help takkaria. You are, for lack of a more profound and relevant term, "da man".
    Last edited by MKula; March 30, 2008, 23:30.
    It breathes on you.
    You die.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      I'm a little confused about UnAngband's subversion repository. Under svnroot/repos/unangband/trunk/unangband, there appears to be a second unangband directory with a second copy of the source. Which one should I check out these days?
      takkaria whispers something about options. -more-

      Comment

      • Bandobras
        Knight
        • Apr 2007
        • 726

        unangband/unangband/ for 0.6.2, unangband for 0.6.3 (and you get 0.6.2 too in the bargain, actually)

        Comment

        • andrewdoull
          Unangband maintainer
          • Apr 2007
          • 872

          Originally posted by Bandobras
          unangband/unangband/ for 0.6.2, unangband for 0.6.3 (and you get 0.6.2 too in the bargain, actually)
          This is due to my complete naivety at how to set up an svn branch... and following someone elses example.

          Andrew
          The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
          In UnAngband, the level dives you.
          ASCII Dreams: http://roguelikedeveloper.blogspot.com
          Unangband: http://unangband.blogspot.com

          Comment

          • ekolis
            Knight
            • Apr 2007
            • 921

            Hey, thought it might be appropriate to mention here that the Vanilla SVN and Trac appear to be down (have been for a few days actually) and no new nightlies have appeared in a few days... something wrong? (Actually at first the whole rephial domain was down but at least most of it's back now...)
            You read the scroll labeled NOBIMUS UPSCOTI...
            You are surrounded by a stasis field!
            The tengu tries to teleport, but fails!

            Comment

            • takkaria
              Veteran
              • Apr 2007
              • 1951

              Originally posted by ekolis
              Hey, thought it might be appropriate to mention here that the Vanilla SVN and Trac appear to be down (have been for a few days actually) and no new nightlies have appeared in a few days... something wrong? (Actually at first the whole rephial domain was down but at least most of it's back now...)
              Yeah, it'll come back when it comes back... I don't host the dev server so I can't fix it. The nightlies rely on the dev server being there, so that's why they fail too.
              takkaria whispers something about options. -more-

              Comment

              • EdRaSm
                Rookie
                • Nov 2008
                • 1

                Managed to compile and run using Eclipse on XP

                I thought I would post my success at getting this to work today. It was quite a bit of trouble, but none of it appears to have been Angband's fault.

                1. Installed Eclipse for C/C++
                2. Installed MinGW, including the G++, Objective C, and makefile options.
                3. Edit \minGW\include\stdlib.h: Change the word 'inline' to the word 'static' on line 317.

                inline double __cdecl __MINGW_NOTHROW strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr)

                should become:

                static double __cdecl __MINGW_NOTHROW strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr)

                I am a VB guy, so I don't understand this change whatsoever. It could be really a bad thing, but it does let angband run.

                4. Get the source code. In Eclipse, do File->New->Other->check out files from SVN. Use http://angband.rogueforge.net/svn/trunk. When it asks which folder, choose the topmost (labeled trunk). Leave everything as the default on the next screen and click Finish. On the 'select a wizard' screen, choose 'C Project'. On the 'C Project' screen, choose Makefile Project->Empty Project, give your project a name (Angband), and choose MinGW GCC on the right pane.

                5. After everything is downloaded, expand the source tree to expose the src folder. Right click it and do Make Targets->Build. Make a new build called default, target can be 'all', and set the build command to 'make -f makefile.win MINGW=yes' (without the quotes).

                6. Copy \mingw\bin\mingw32-make.exe to \mingw\bin\make.exe.

                7. Put \mingw\bin on your path. There is probably a better way, but it seemed to me that I had to reboot to get this to take. I edited the path by right clicking my computer and click set environment variables on the advanced tab.

                8. 6 and 7 could have been done earlier, I just forgot to put them there

                9. Right click on the src folder in Eclipse, choose Make Targets, choose default and click Build.

                10. The only part that didn't work for me was the automatic copying of angband.exe up a level. I did that by hand for now.
                Last edited by EdRaSm; November 29, 2008, 18:51.

                Comment

                • meeshoo
                  Scout
                  • Jan 2009
                  • 27

                  I can't seem to pass this error:
                  Code:
                  D:\Personal\Angband\src>mingw32-make -f Makefile.win MINGW=yes
                  gcc -DWINDOWS -Wall -W -std=iso9899:199409 -pedantic -O2 -I. -c -o attack.o atta
                  ck.c
                  In file included from h-basic.h:127,
                                   from angband.h:17,
                                   from attack.c:18:
                  D:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:317: error: s
                  yntax error before "double"
                  In file included from angband.h:35,
                                   from attack.c:18:
                  defines.h:1398: warning: comma at end of enumerator list
                  mingw32-make: *** [attack.o] Error 1
                  Any ideas on it? I skiped the java and got the svn down using tortoise and then installed mingw/msys and tried to build both from msys command promt and cmd shell and the result is the same.

                  I am trying to build under Vista (I'm running all command prompts with administrator rights).

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9637

                    Originally posted by meeshoo
                    Any ideas on it?
                    This seems to be a bug in mingw (these are not unknown )- see this page, which I think has a workaround.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • meeshoo
                      Scout
                      • Jan 2009
                      • 27

                      Well, I managed to build it in the end but not using MinGW. I tried all the fixes on the page Nicks suggested but it didn't work, so I just dropped MinGW and installed CygWin and everything worked without any problems.

                      First I tried the method described on the first page with Eclipse, and it refused to start, now I know why because I tried same thing but with Cygwin. The problem was that when you create the new make target, you can name your target default, but you have to leave the "make target" box empty, or else it adds that target to the make command string, and says some error about "no rule to make target 'default'".
                      Last edited by meeshoo; January 13, 2009, 11:31.

                      Comment

                      • pav
                        Administrator
                        • Apr 2007
                        • 793

                        The default target is 'all' if you want to specify it. Or leave the box empty, yeah.
                        See the elves and everything! http://angband.oook.cz

                        Comment

                        • zaimoni
                          Knight
                          • Apr 2007
                          • 590

                          Originally posted by meeshoo
                          I can't seem to pass this error:
                          Code:
                          D:\Personal\Angband\src>mingw32-make -f Makefile.win MINGW=yes
                          gcc -DWINDOWS -Wall -W -std=iso9899:199409 -pedantic -O2 -I. -c -o attack.o atta
                          ck.c
                          In file included from h-basic.h:127,
                                           from angband.h:17,
                                           from attack.c:18:
                          D:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:317: error: s
                          yntax error before "double"
                          In file included from angband.h:35,
                                           from attack.c:18:
                          defines.h:1398: warning: comma at end of enumerator list
                          mingw32-make: *** [attack.o] Error 1
                          Any ideas on it? I skiped the java and got the svn down using tortoise and then installed mingw/msys and tried to build both from msys command promt and cmd shell and the result is the same.

                          I am trying to build under Vista (I'm running all command prompts with administrator rights).
                          MingW's recent releases of stdlib.h is broken under strict C94. I bypass this by patching Makefile.win :

                          Code:
                          C:\CPP_App\angband.svn\src>svn diff Makefile.win
                          Index: Makefile.win
                          ===================================================================
                          --- Makefile.win        (revision 1105)
                          +++ Makefile.win        (working copy)
                          @@ -47,7 +47,8 @@
                          
                           CC = $(CROSS)gcc
                           WRES = $(CROSS)windres
                          -CFLAGS += -Wall -W -std=iso9899:199409 -pedantic -O2 -I.
                          +CFLAGS += -Wall -W -pedantic -O2 -I.
                          +#CFLAGS += -Wall -W -std=iso9899:199409 -pedantic -O2 -I.
                           LIBS += -s
                          
                           ifdef BUILD_ID
                          Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
                          Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
                          Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

                          Comment

                          • meeshoo
                            Scout
                            • Jan 2009
                            • 27

                            It works, thanks a lot, this really helps. Now I can get rid of cygwin.

                            EDIT: BTW, is anyone around who tried to build angband using the Code::Blocks IDE + MinGW?
                            Last edited by meeshoo; January 14, 2009, 13:31.

                            Comment

                            • meeshoo
                              Scout
                              • Jan 2009
                              • 27

                              Never mind, I managed to build it myself using Code::Blocks. If anyone is interested in how it's done, please let me know and I'll post a tutorial about it. The main idea is that even Code::Blocks will allow you to use a custom make file, you shouldn't use a custom make file but configure your own build targets for each platform (which files go in, which libraries go in and so on). Even if it sounds hard, it is not, as you can use the platform's specific makefile to determine which flags you should pass to the compiler and linker. Also you have to set the search folders properly for includes and resources.

                              Comment

                              • Old Coach
                                Apprentice
                                • Feb 2009
                                • 61

                                meeshoo
                                you used eclipse to build your program and cygwin to compile as the instructions gave at the beginning of the thread?
                                What command did you run in place of the "mingw32-make -f makefile.cyg"

                                I just want to compile angband from the source code as a matter of principal.

                                -Fred

                                Comment

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