Compile Error in Ubuntu 13.04

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bobthegreat
    Rookie
    • Mar 2009
    • 12

    Compile Error in Ubuntu 13.04

    Trying to compile Angband in Ubuntu 13.04, and every time I try to run "make" I get:

    Code:
    main.c:38:1: warning: ISO C forbids empty initializer braces [-pedantic]
    main.c:37:28: error: zero or negative size array ‘modules’
    Failed to compile main.c!
    make[3]: *** [main.o] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [subdirs] Error 1
    make: *** [all] Error 1
    It's likely this is somehow my fault cause I'm quite noobish with linux, but I haven't been able to find anything about how to solve it. Thanks for the help!
    Last edited by bobthegreat; September 15, 2013, 03:10.
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by bobthegreat
    Trying to compile Angband in Ubuntu 13.04, and every time I try to run "make" I get:

    Code:
    main.c:38:1: warning: ISO C forbids empty initializer braces [-pedantic]
    main.c:37:28: error: zero or negative size array ‘modules’
    Failed to compile main.c!
    make[3]: *** [main.o] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [subdirs] Error 1
    make: *** [all] Error 1
    It's likely this is somehow my fault cause I'm quite noobish with linux, but I haven't been able to find anything about how to solve it. Thanks for the help!
    This happens when you don't install the right development libraries, or when you don't tell configure which frontends to use. If you run ./configure, what are the last few lines of output?
    takkaria whispers something about options. -more-

    Comment

    • bobthegreat
      Rookie
      • Mar 2009
      • 12

      #3
      Ok, what I get is:

      Code:
      Configuration:
      
        Install path:                           /usr/local
        binary path:                            /usr/local/games
        config path:                            /usr/local/etc/angband/
        lib path:                               /usr/local/share/angband/
        var path:                               (not used)
        (with private save and score files in ~/.angband/Angband/)
      
      -- Frontends --
      - Curses                                  No; missing libraries
      - X11                                     No; missing libraries
      - SDL                                     Disabled
      - Windows                                 Disabled
      - Test                                    No
      - Stats                                   No
      
      - SDL sound                               Disabled

      Comment

      • bobthegreat
        Rookie
        • Mar 2009
        • 12

        #4
        I installed x11, now everything works! Thanks so much!

        Comment

        • discochoir
          Rookie
          • Jan 2014
          • 5

          #5
          Having the same problem, Ubuntu 13.10, also noobish.
          compiling to the directory its currently in, looks like this:
          Code:
          LINK angband.o           
          main.c:38:1: warning: ISO C forbids empty initializer braces [-Wpedantic]
           {
           ^
          main.c:37:28: error: zero or negative size array ‘modules’
           static const struct module modules[] =
                                      ^
          Failed to compile main.c!
          make[3]: *** [main.o] Error 1
          make[2]: *** [all] Error 1
          make[1]: *** [subdirs] Error 1
          make: *** [all] Error 1
          the last few lines of the ./configure are:
          Code:
          Configuration:
          
            Install path:                           /usr/local
            binary path:                            /usr/local/games
            config path:                            /usr/local/etc/angband/
            lib path:                               /usr/local/share/angband/
            var path:                               (not used)
            (with private save and score files in ~/.angband/Angband/)
          
          -- Frontends --
          - Curses                                  No; missing libraries
          - GTK 2.x                                 Disabled
          - X11                                     No; missing libraries
          - SDL                                     Disabled
          - Test                                    No
          - Stats                                   No
          
          - SDL sound                               No; missing libraries
          Not sure what this x11 business is, i have xauth installed and up-to-date though. Thanks ahead.

          EDIT:
          If this helps, I downloaded from the "official" page. http://rephial.org/
          EDIT:
          Just for kicks, I checked out Ubuntu Software center. It might be an older version, but Angband3.3 is there. Installs all on its own like magic. Problem solved.
          Honest opinion, why is a compiled executable not more commonly distributed? Seems a shame to me, but alas, i've not the knowledge to do anything about it.
          Last edited by discochoir; January 15, 2014, 07:34.
          "And why not? For the mind of man is capable of anything - because everything is in it, all the past as well as all the future."

          Comment

          • fph
            Veteran
            • Apr 2009
            • 1030

            #6
            The problem is that each possible graphical interfaces (X11, GTK, console/curses, etc.) depends on some development libraries being installed, and you don't have enough of them to compile even a single one.

            Check the instructions in http://trac.rephial.org/wiki/Compiling. In particular, you'll need the third command in that guide:
            Code:
             $ sudo apt-get install autoconf gcc libc6-dev libncurses5-dev libx11-dev \
                         libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev \
                         libgtk2.0-dev libglade2-dev
            (write everything excluding the initial $ symbol in a terminal) and then it should work.

            (I agree, there could be a better error message).
            --
            Dive fast, die young, leave a high-CHA corpse.

            Comment

            • discochoir
              Rookie
              • Jan 2014
              • 5

              #7
              Ah, perfect. Thank you, it's working fine now.
              "And why not? For the mind of man is capable of anything - because everything is in it, all the past as well as all the future."

              Comment

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