Getting Unangband/Angband from SVN and Compiling on Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bandobras
    Knight
    • Apr 2007
    • 726

    #91
    Yeah, always be in good standings with your virus programs.

    Comment

    • pav
      Administrator
      • Apr 2007
      • 793

      #92
      Or get an anti-virus program for a change.
      See the elves and everything! http://angband.oook.cz

      Comment

      • Anne
        Adept
        • Feb 2008
        • 134

        #93
        (You know, it occured to me that since I ended up doing this a completely different way than the original instructions said to, and since it's been so spread out over three pages of this thread, I might as well consolidate this method for the benefit of posterity. I don't imagine I'll be the only person that the original instructions don't work for.)

        Alternate Method for Getting and Compiling the game - for Totally Clueless Windows Users like me.

        If the original instructions in this thread don't work for you (or you just don't want to download Eclipse), here's the summary of how I got it working (with a LOT of help from the good people here). Note that this method will allow you to compile the nightly builds, but it won't help you if you want to actually get into development.

        1. For this method, you'll still need to download:
        MinGW and MSYS and also
        TortoiseSVN (click on the Installer).
        But you won't need Eclipse, which is a far larger download than either of the above.

        2. Once you've installed the above programs, you need to add MinGW to your PATH:
        Right-click on My Computer and choose 'Properties'.
        Choose the 'Advanced' tab.
        Click on the 'Environment Variables' down at the bottom.
        In the bottom box, click on 'Path' and then click on 'Edit'.
        In the field you're presented with, you want to add a semicolon ';' to the end of what's already there and then type 'C:\mingw\bin
        Click OK and then OK again to get out out My Computer entirely.

        3. Go into your C: (local disk) folder and create a folder there called 'workspace'.
        Right-click on it and select SVN update.
        If you want Unangband, in the address field, put:

        Or if you want Angband, in the address field, put:

        The TortoiseSVN will then download the current game files (an hour and a half on my tortuously slow dialup).

        4. Once your files have finished downloading, bring up
        Programs / Accessories / Command Prompt
        That will bring up what looks like a DOS window.

        You want to be in the game files' src folder. To get there, you need to use the 'cd' (that's 'change directory') command, so you type:
        'cd C:\workspace\trunk\unangband\src'
        (or substitute the address for the Angband src folder)

        That should put you where you belong. Type:
        'make -f Makefile.win MINGW=yes'

        If it tells you that 'make' is not recognized, then you'll need to do the following instead:
        'mingw32-make -f Makefile.win MINGW=yes'
        If either of the above is successful, you'll see many lines of text appear as it works. Wait until it's finished.

        The last thing that should appear will be:
        copy unangband.exe ..
        1 file(s) copied.

        As a result, when you look inside that src folder now, you should find the unangband.exe file (or angband.exe) in there, which looks like the angband icon (but don't mistake it for the other one that's JUST an icon - you want the application).

        5. Copy that .exe file, go up one level into the 'unangband' folder (or if you're doing Angband, whatever folder houses the src folder), and paste it there.

        You should now be able to double-click on that .exe that you just pasted to run the game. If it doesn't run right, try rebooting your computer (that works for me).

        6. If you'd like, you can right-click on that and choose 'Create Shortcut' which you can then drag onto your desktop. That allows you to play the game directly from the Workspace folder without having to install it anywhere first.

        After that, in order to compile the nightly builds, you'll want to go into My Computer and then into your C: folder. Right-click on the Workspace folder and choose SVN Update. It should immediately start downloading the new files for you, and then you'll need to compile them again afterward, starting with Step #4.

        If it won't let you Update those files, telling you that it's locked, and releasing that lock doesn't help, then you'll need to delete your entire Workspace folder and start from Step #3 instead.
        Last edited by Anne; March 12, 2008, 05:18.

        Comment

        • Pete Mack
          Prophet
          • Apr 2007
          • 6883

          #94
          That's great anne-
          I have two suggestions: semicolon inside of parentheses is rendered as an emoticon with a hat (
          Use ';' instead.

          You don't need to use .. to navigate to C:\

          You can use:

          cd C:\

          instead.

          Comment

          • Anne
            Adept
            • Feb 2008
            • 134

            #95
            Ooh, thanks, Pete! Fixed. Less typing is always a good thing. lol.

            Comment

            • Pete Mack
              Prophet
              • Apr 2007
              • 6883

              #96
              Whoops, I found another nit. The link to Tortoise SVN goes to a MINGW installer. Tortoise is http://tortoisesvn.tigris.org/. It looks pretty cool, though I think I will stick with commandline svn.

              Comment

              • Anne
                Adept
                • Feb 2008
                • 134

                #97
                Glad you caught that. I must have pasted the wrong link there. Fixed. TortoiseSVN is the one recommended for Windows on that compiling page at rephial.org that you linked me to earlier. Works very nicely for me.

                Comment

                • MKula
                  Apprentice
                  • Feb 2008
                  • 70

                  #98
                  Hey all;
                  So, I'm trying to compile the Windows version (3.0.9b) from the source using the "official" instructions on the /wiki/Compiling page. It seems to work quite well using Dev-C++, etc.

                  Just a few points, that messed me up for a while, that I'd like to share with other who might be trying as well:
                  1) When you make a New Project, make sure it's a C project, NOT a C++ project.
                  2) For a typical Windows build (I'm doing it on Windows XP), you need to include all the SDL, as well as the Windows, flags; you must include them all or it won't work.

                  HOWEVER (and here's the real reason I'm posting this), I'm still getting one message that I can't seem to fix. I get this compiler (linker?) error:

                  cannot find -lSDL
                  ld returned 1 exit status
                  [Build Error] [../Angband.exe] Error 1

                  This error is in (or associated with) makefile.win, apparently. If I try removing that flag from Project Options/Parameters, I get the same error for -lSDLmain, and then if I delete -iSDLmain, it happens again for -lSDL_tff. However, if I then delete -lSDL_tff, the error changes to a whole list of "undefined" statements.

                  Any suggestions?

                  EDIT: I just made a discovery: I don't have the SDL libraries installed, and they seem to be necessary. I'll post a further update when I get that sorted out.
                  Last edited by MKula; March 29, 2008, 19:01.
                  It breathes on you.
                  You die.

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #99
                    Originally posted by MKula
                    Hey all;
                    So, I'm trying to compile the Windows version (3.0.9b) from the source using the "official" instructions on the /wiki/Compiling page. It seems to work quite well using Dev-C++, etc.

                    Just a few points, that messed me up for a while, that I'd like to share with other who might be trying as well:
                    1) When you make a New Project, make sure it's a C project, NOT a C++ project.
                    2) For a typical Windows build (I'm doing it on Windows XP), you need to include all the SDL, as well as the Windows, flags; you must include them all or it won't work.

                    HOWEVER (and here's the real reason I'm posting this), I'm still getting one message that I can't seem to fix. I get this compiler (linker?) error:

                    cannot find -lSDL
                    ld returned 1 exit status
                    [Build Error] [../Angband.exe] Error 1

                    This error is in (or associated with) makefile.win, apparently. If I try removing that flag from Project Options/Parameters, I get the same error for -lDSLmain, and then if I delete -iDSLmain, it happens again for -lDSL_tff. However, if I then delete -lDSL_tff, the error changes to a whole list of "undefined" statements.

                    Any suggestions?
                    I would suggest that you don't have the SDL libraries. Furthermore, I would suggest your point 2 above is wrong: you only include the SDL libraries if you want the SDL port. So try following the instructions for just the Windows port, and then report what issues you have with that.
                    takkaria whispers something about options. -more-

                    Comment

                    • MKula
                      Apprentice
                      • Feb 2008
                      • 70

                      Originally posted by takkaria
                      I would suggest that you don't have the SDL libraries. Furthermore, I would suggest your point 2 above is wrong: you only include the SDL libraries if you want the SDL port. So try following the instructions for just the Windows port, and then report what issues you have with that.
                      Thanks for the fast reply, takkaria!
                      Yeah, clearly you're right. I realized the SDL issue after. I seemed to "get a better result" if I included the SDL stuff, that's why I said that, but that's obvisously not the case since it doesn't compile either way. Anyway:

                      If I use just the "Windows only" options, it dones't compile either. I gut a whole list of linker errors, almost all of the referring to an "undefined SDL_foo". A sample of (of the roughly 30 errors):

                      [Linker error] undefined reference to 'SDL_FillRect'
                      [Linker error] undefined reference to 'TTF_OpenFont'
                      [Linker error] undefined reference to 'SDL_GetError'
                      etc, etc...

                      EDIT: So I tried restarting from scratch, with a brand new blank project. This time, the errors are much simpler; the compiler log lists the following at the end (essentially, after all the stuff that 'worked'):
                      <snip>
                      "Angband.exe" -L"C:/Dev-Cpp/lib" -lmingwin32 -lwinmm -mwindows
                      C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw 32\bin\ld.exe: cannot find -lmingwin32
                      collect2: ld returned 1 exit status
                      make.exe: *** [Angband.exe] Error 1
                      Execution terminated

                      Any help would be enormously appreciated! Thanks in advance.
                      Last edited by MKula; March 30, 2008, 05:24.
                      It breathes on you.
                      You die.

                      Comment

                      • takkaria
                        Veteran
                        • Apr 2007
                        • 1951

                        Originally posted by MKula
                        EDIT: So I tried restarting from scratch, with a brand new blank project. This time, the errors are much simpler; the compiler log lists the following at the end (essentially, after all the stuff that 'worked'):
                        <snip>
                        "Angband.exe" -L"C:/Dev-Cpp/lib" -lmingwin32 -lwinmm -mwindows
                        C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw 32\bin\ld.exe: cannot find -lmingwin32
                        collect2: ld returned 1 exit status
                        make.exe: *** [Angband.exe] Error 1
                        Execution terminated
                        Try removing -lmingwin32 and replacing it with -lmingw32, see if that helps. If that doesn't help, then try removing the -lmingw[in]32 option entirely.
                        takkaria whispers something about options. -more-

                        Comment

                        • MKula
                          Apprentice
                          • Feb 2008
                          • 70

                          Originally posted by takkaria
                          Try removing -lmingwin32 and replacing it with -lmingw32, see if that helps. If that doesn't help, then try removing the -lmingw[in]32 option entirely.
                          Hmmm.... still no go.
                          Replacing the line with -lmingw32 reproduces the "[Linker error] undefined reference to foo" list of errors. Removing the line(s) entirely does the same thing.
                          My main question is, what causes a linker error of this type? Am I missing a set of files/libraries that I don't know I need? That seems to be the case, since it seems to be trying to reference something that's not there.

                          EDIT: All the linker errors seem to reference "main-sdl.c", if that helps. If I remove main-sdl.c from the list of project files, I get another error, associated with "main.c" that says "[Linker Error] undefined reference to WinMain@16", if *that* helps...
                          Last edited by MKula; March 30, 2008, 17:25.
                          It breathes on you.
                          You die.

                          Comment

                          • takkaria
                            Veteran
                            • Apr 2007
                            • 1951

                            Originally posted by MKula
                            Hmmm.... still no go.
                            Replacing the line with -lmingw32 reproduces the "[Linker error] undefined reference to foo" list of errors. Removing the line(s) entirely does the same thing.
                            My main question is, what causes a linker error of this type? Am I missing a set of files/libraries that I don't know I need? That seems to be the case, since it seems to be trying to reference something that's not there.
                            Yeah, that's pretty much it.

                            EDIT: All the linker errors seem to reference "main-sdl.c", if that helps. If I remove main-sdl.c from the list of project files, I get another error, associated with "main.c" that says "[Linker Error] undefined reference to WinMain@16", if *that* helps...
                            Remove main.c from it too. Make sure main-win.c is there, too.
                            takkaria whispers something about options. -more-

                            Comment

                            • MKula
                              Apprentice
                              • Feb 2008
                              • 70

                              If I remove all the "main-xxx.c" files (except "main-win.c"), as well as "main.c", the only error I (still) get is "[Linker error] undefined reference to 'WinMain@16'" which STILL references main.c (even though I removed it).
                              I also tried renaming "main-win.c" to "main.c", but that still gives the same error as above. Hmm...
                              It breathes on you.
                              You die.

                              Comment

                              • takkaria
                                Veteran
                                • Apr 2007
                                • 1951

                                Originally posted by MKula
                                If I remove all the "main-xxx.c" files (except "main-win.c"), as well as "main.c", the only error I (still) get is "[Linker error] undefined reference to 'WinMain@16'" which STILL references main.c (even though I removed it).
                                I also tried renaming "main-win.c" to "main.c", but that still gives the same error as above. Hmm...
                                Please make sure that the compiler flags include -DWINDOWS and do not include -DUSE_SDL. I can't see anything else being the problem.
                                takkaria whispers something about options. -more-

                                Comment

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