Getting Unangband/Angband from SVN and Compiling on Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Old Coach
    Apprentice
    • Feb 2009
    • 61

    If I just wanted to download the source file and compile it, what would be the best compiler to use?
    Windows xp operating system.
    -Fred

    Comment

    • Pete Mack
      Prophet
      • Apr 2007
      • 6883

      gcc mingw package, or cygwin if you already use it.
      (There are instructions early in this thread.)

      Comment

      • Old Coach
        Apprentice
        • Feb 2009
        • 61

        Thank you, Thank you, Anna and Zaimoni!
        You guys are the best!
        Anna, your headaches and perseverance have saved me a lot of headaches and perseverance!
        -Fred

        Comment

        • Jungle_Boy
          Swordsman
          • Nov 2008
          • 434

          By combining the knowledge presented in this thread I have now managed to accomplish this on two computers and I thought I would share some of my insights.

          Most of the instructions given in the first post are good but the links are usually different. One you've accomplished getting the programs and have the source code in Eclipse you need to right click the main Angband directory and convert it to a C/C++ project. This allows you to right click the src directory and click Make Targets>Build. The target name is 'default' the Make target is blank and the build command (for angband) is mingw32-make -f makefile.win mingw=yes. Unfortunately this will not work just yet. You need to edit the makefile.win as mentioned by Zaimoni on the previous page and you also need to download a corrected stdlib.h that is linked on the page Nick linked a few posts before that. After doing this it works perfectly with no errors or warnings. Almost like it was planned that way! This was for the winXP operating system.
          My first winner: http://angband.oook.cz/ladder-show.php?id=10138

          Comment

          • PaulBlay
            Knight
            • Jan 2009
            • 657

            This can also be done relatively painlessly using TortoiseSVN and Visual C++

            Windows, Visual C++ and TortoiseSVN for Angband SVN compile

            1. Download and install TortoiseSVN (requires reboot)

            2. Navigate to a convenient folder (using Explore or via My Computer), right-click and choose "SVN Checkout" menu option.

            3. Enter "svn://rephial.org/angband/trunk" for the url of repository. Click OK and you should have the latest SVN source on your computer in a few minutes.

            4. Copy the source code somewhere else (if you want to mess around with it).

            5. Install Microsoft Visual C++ 2008 Express Edition.

            6. Start the Visual Studio 2008 command prompt and change to the
            source directory of angband (e.g. C:\angbandSVN\src\ )

            7. Make the file with
            nmake /fMakefile.nmake RELEASE=1
            (leave off the RELEASE=1 for a debug compile)
            Currently turning (Angband) Japanese.

            Comment

            • ekolis
              Knight
              • Apr 2007
              • 921

              Oh, sweet! So that's what nmake is for... I thought you needed a Visual Studio solution to build anything in VC++...
              You read the scroll labeled NOBIMUS UPSCOTI...
              You are surrounded by a stasis field!
              The tengu tries to teleport, but fails!

              Comment

              • YeGoblynQueenne
                Rookie
                • Jul 2010
                • 4

                Just a bit of feedback on my various attempts to compile Angband under Windows XP in the last few days:

                With Cygwin: failed!
                "This application has requested the Runtime to terminate it in an unusual way". Uh oh.

                With MingW32 (from the cmd line): compiled OK!
                Note: make.exe is (typically) in C:/msys/bin; C:/Mingw/bin has mingw32-make.exe. I compiled with "mingw32-make -f Makefile.win" (because a friendly program was pointing to its own make.exe inside my PATH. I should probably fix that and use make.exe).
                Also see http://www.mingw.org/wiki/FAQ for an answer to "How do I use MinGW with Cygwin?" (without -mno-cygwin).

                With the Netbeans IDE 6.8: compiled OK!
                Note: when compile finished I thought it had failed because the screen was all black. Pressing Enter I could see the cursor jumping around options, but I couldn't see anything else. Reboot fixed that, so now it's OK and I'm playing from it to test it.
                Note: make a new "C/C++ Project with Existing Sources", then "Select Configuration Mode: Custom", so that you can tell it which makefile to use and what libraries to include.

                With Eclipse IDE, Gallileo 3.5.2 (C/C++ Dev tools 6.0.2). Failed!
                Bunch of errors that make no sense. I tried changing the build command but still no luck. I tried placing all the .c's and .h's in one src dir but there's an identically-named file in each of the object, player, monster etc dirs (type.c). That's a bit rude, innit?

                With DevC++: Failed!
                "Too many errors. There must be something terribly wrong with your code. Fix it". Hey! It's not my code! My "Hello World" compiles just fine, thank you.

                Visual C++ 2005 (not Express; we get free copies at uni), both at the command line and as a project. Failed!
                Who cares?


                I'm also compiling Nethack and it only worked with Mingw. All of the above failures must be because I haven't a clue about C or C++. In any case I think I prefer the notepad++ & cmd-line approach, for that authentic retro feeling

                Next, I'll give it a try to cross-compile in Linux, but that should be pretty straightforward, right?
                (She said and jumped without a parachute).

                Btw, this is probably not the right place to ask but does anyone know which files handle the UI? I would like to try and compile them separately, if at all possible.

                Comment

                • hernaldo
                  Rookie
                  • Jul 2010
                  • 14

                  Hi,
                  First,. excelent tutorial!
                  Second, i have a question:
                  I can compile the Angband in DOS sussessfuly using:
                  > CD C:\workspace\angband\src
                  > mingw32-make.exe -f makefile.win

                  But i can't compile using Eclipse (step 22), this is my build configuration:




                  This is the errors:


                  **** Rebuild of configuration Debug for project Angband ****

                  **** Internal Builder is used for build ****
                  gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\monster\melee1.o ..\src\monster\melee1.c
                  ..\src\monster\melee1.c:18:21: angband.h: No such file or directory
                  ..\src\monster\melee1.c:19:29: object/tvalsval.h: No such file or directory
                  ..\src\monster\melee1.c: In function `monster_critical':
                  ..\src\monster\melee1.c:36: warning: implicit declaration of function `randint0'
                  ..\src\monster\melee1.c: At top level:
                  ..\src\monster\melee1.c:63: error: syntax error before "check_hit"
                  ..\src\monster\melee1.c:64: warning: return type defaults to `int'
                  ..\src\monster\melee1.c: In function `check_hit':


                  any help?

                  Comment

                  • hernaldo
                    Rookie
                    • Jul 2010
                    • 14

                    Hi
                    i've tried compile Angband in Eclipse how andrewdoull explain, and i get this error when i select Angband -> Src -> 2nd button -> Make Target -> Build

                    Code:
                    **** Rebuild of configuration Debug for project Angband ****
                    
                    **** Internal Builder is used for build               ****
                    gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\player\calcs.o ..\src\player\calcs.c
                    ..\src\player\calcs.c:19:21: angband.h: No such file or directory
                    ..\src\player\calcs.c:20:24: game-event.h: No such file or directory
                    ..\src\player\calcs.c:21:29: object/tvalsval.h: No such file or directory
                    ..\src\player\calcs.c: In function `calc_spells':
                    ..\src\player\calcs.c:38: error: syntax error before '*' token
                    ..\src\player\calcs.c:40: error: `s16b' undeclared (first use in this function)
                    ..\src\player\calcs.c:40: error: (Each undeclared identifier is reported onl
                    I have this build command in Make Target: "mingw32-make -f Makefile.win"

                    However, if I use Mingw with command line
                    > mingw32-make.exe -f makefile.win
                    it works!

                    please help!
                    Last edited by hernaldo; July 22, 2010, 04:08.

                    Comment

                    • andrewdoull
                      Unangband maintainer
                      • Apr 2007
                      • 872

                      I'm using mingw32-make -f makefile.win MINGW=yes at the moment in Eclipse, which works for Unangband.

                      I suspect your problem is with the way the project is set up. I'm unlikely to have time to help you with this, but I'm sure someone else on the forum can...

                      Anderw
                      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

                      • hernaldo
                        Rookie
                        • Jul 2010
                        • 14

                        hi, I get an error very similar:

                        Code:
                        **** Rebuild of configuration Debug for project Angband ****
                        
                        **** Internal Builder is used for build               ****
                        gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\score.o ..\src\score.c
                        gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\ui.o ..\src\ui.c
                        gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\monster\melee1.o ..\src\monster\melee1.c
                        ..\src\monster\melee1.c:18:21: angband.h: No such file or directory
                        ..\src\monster\melee1.c:19:29: object/tvalsval.h: No such file or directory
                        ..\src\monster\melee1.c: In function `monster_critical':
                        ..\src\monster\melee1.c:36: warning: implicit declaration of function `randint0'
                        ..\src\monster\melee1.c: At top level:
                        ..\src\monster\melee1.c:63: error: syntax error before "check_hit"
                        ..\src\monster\melee1.c:64: warning: return type defaults to `int'
                        ..\src\monster\melee1.c: In function `check_hit':
                        ..\src\monster\melee1.c:71: error: `p_ptr' undeclared (first use in this function)
                        ..\src\monster\melee1.c:71: error: (Each undeclared identifier is reported only once
                        ..\src\monster\melee1.c:71: error: for each function it appears in.)
                        ..\src\monster\melee1.c:74: warning: implicit declaration of function `test_hit'
                        What other options I can to check in Eclipse?

                        Comment

                        • Pete Mack
                          Prophet
                          • Apr 2007
                          • 6883

                          You are running the build from the wrong directory (src/monster rather than src).
                          If you add .. to the include path, you will solve this problem. But there will be a lot more...

                          Comment

                          • hernaldo
                            Rookie
                            • Jul 2010
                            • 14

                            You are running the build from the wrong directory (src/monster rather than src).
                            If you add .. to the include path, you will solve this problem. But there will be a lot more...
                            sorry for my question, but do you say in the My Computer->Environment Variables-> Path ? -> I have ";C:\mingw\bin" as says the guide.

                            Or in the Eclipse -> Make Target -> Build Command? -> here I have:

                            Target name: default
                            Make target:checked "same as the targe name"
                            Build Command: unchecked "use builder settings"
                            build command: mingw32-make -f makefile.win MINGW=yes
                            Build settings: checked "Run all proyects buildres."

                            thanks!

                            Comment

                            • jens
                              Swordsman
                              • Apr 2011
                              • 348

                              Hi!

                              I'm new to this forum (but not to Angband :-) and am trying to follow the instructions at the start of this thread to get the source and compile in Eclipse. I have installed the Eclipse plugin for SVN, but when trying 'svn://rephial.org/angband/trunk' I get an error indicating that the folder does not exist remotely...

                              Looking around for a bit I find that the repository has changed, and Git is now used instead of SVN, is this correct? Should I get EGit (the Eclipse addon for Git)? I don't want to clutter my installation of Eclipse with too many unnecessary plugins... Or is there another best practice for getting the source into Eclipse?

                              /Jens

                              Comment

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