Trying to compile on Windows 8

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SlothsInTheDungeon
    Rookie
    • Aug 2014
    • 3

    Trying to compile on Windows 8

    Hey folks, I'm trying to compile Angband using the GCC compiler in Code::Blocks. After adding sqlite3 inside the source file it compiles for awhile until it reaches line 39 in db.c.


    static bool stats_make_output_dir(void) {
    size_t size = strlen(ANGBAND_DIR_USER) + strlen(PATH_SEP) + 6;
    ANGBAND_DIR_STATS = mem_alloc(size * sizeof(char));
    path_build(ANGBAND_DIR_STATS, size, ANGBAND_DIR_USER, "stats");

    if (dir_create(ANGBAND_DIR_STATS)) {
    return true;
    } else {
    return false;
    }
    }


    The build message says:
    error: 'true undeclared (first use in this function)
    error: 'false' undeclared (first use in this function)

    Does anyone know what could be causing these errors?
  • AnonymousHero
    Veteran
    • Jun 2007
    • 1393

    #2
    What do you mean by "adding sqlite3 inside the source file", exactly?

    Comment

    • SlothsInTheDungeon
      Rookie
      • Aug 2014
      • 3

      #3
      Originally posted by AnonymousHero
      What do you mean by "adding sqlite3 inside the source file", exactly?
      Well, when I was compiling, db.c (I believe it was db.c) needed sqlite3.h. So I downloaded the source for sqlite3 and then added it into src.

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9634

        #4
        Originally posted by SlothsInTheDungeon
        The build message says:
        error: 'true undeclared (first use in this function)
        error: 'false' undeclared (first use in this function)

        Does anyone know what could be causing these errors?
        My guess is that you need to change all the occurrences of 'true' and 'false' to 'TRUE' and 'FALSE'.

        The bit you're compiling is part of the stats module, which I didn't think compiled by default on windows - but I guess you're not using the default windows compilation method. What actually are you doing? This sounds interesting.
        Last edited by Nick; August 7, 2014, 21:58. Reason: more explanation
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • SlothsInTheDungeon
          Rookie
          • Aug 2014
          • 3

          #5
          Originally posted by Nick
          My guess is that you need to change all the occurrences of 'true' and 'false' to 'TRUE' and 'FALSE'.
          It worked! Though now I'm getting two more kinds of errors. The first one was pointing out multiple definitions for a variety of functions. I did a little research and found that adding static const seemed to have taken care of that particular error. Now, I don't know if what I did was extremely stupid(starting to learn C and all) but it continued to compile. Most of the files were in tests.

          The second error came from winnt.h(Windows SDK). What it wants me to do is "define a target architecture." I have no idea how to do that.

          Originally posted by Nick
          The bit you're compiling is part of the stats module, which I didn't think compiled by default on windows - but I guess you're not using the default windows compilation method. What actually are you doing? This sounds interesting.
          I just followed the compilation guide for Visual Studio in the source file and applied it to Code::Blocks instead.

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9634

            #6
            Originally posted by SlothsInTheDungeon
            It worked! Though now I'm getting two more kinds of errors. The first one was pointing out multiple definitions for a variety of functions. I did a little research and found that adding static const seemed to have taken care of that particular error. Now, I don't know if what I did was extremely stupid(starting to learn C and all) but it continued to compile. Most of the files were in tests.
            My guess is that that's fine - tests shouldn't matter for your purposes anyway.

            Originally posted by SlothsInTheDungeon
            The second error came from winnt.h(Windows SDK). What it wants me to do is "define a target architecture." I have no idea how to do that.
            OK, this is a complete guess, but there is probably a menu setting somewhere (probably a menu called build or compile or some such) where you can choose things like i586 or x86-64, or maybe win32 or win64, or something like that. Pick one and hope for the best
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

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