Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old August 7, 2014, 18:22   #1
SlothsInTheDungeon
Rookie
 
Join Date: Aug 2014
Posts: 3
SlothsInTheDungeon is on a distinguished road
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?
SlothsInTheDungeon is offline   Reply With Quote
Old August 7, 2014, 18:26   #2
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,391
AnonymousHero is on a distinguished road
What do you mean by "adding sqlite3 inside the source file", exactly?
AnonymousHero is offline   Reply With Quote
Old August 7, 2014, 18:54   #3
SlothsInTheDungeon
Rookie
 
Join Date: Aug 2014
Posts: 3
SlothsInTheDungeon is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
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.
SlothsInTheDungeon is offline   Reply With Quote
Old August 7, 2014, 21:53   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 57
Posts: 9,481
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by SlothsInTheDungeon View Post
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.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

Last edited by Nick; August 7, 2014 at 21:58. Reason: more explanation
Nick is offline   Reply With Quote
Old August 9, 2014, 02:53   #5
SlothsInTheDungeon
Rookie
 
Join Date: Aug 2014
Posts: 3
SlothsInTheDungeon is on a distinguished road
Quote:
Originally Posted by Nick View Post
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.

Quote:
Originally Posted by Nick View Post
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.
SlothsInTheDungeon is offline   Reply With Quote
Old August 9, 2014, 03:17   #6
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 57
Posts: 9,481
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by SlothsInTheDungeon View Post
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.

Quote:
Originally Posted by SlothsInTheDungeon View Post
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.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
T2 Linux -> Windows cross-compile with CMake? Therem Harth ToME 0 December 16, 2012 17:00
Unable to compile O Rydel Development 0 November 2, 2011 04:36
Issue with compile on Windows 7 64-bit using Visual C++ Express command line -K- Development 1 January 15, 2011 20:28
Trying to compile 3.1.2v2 on OS X kLy Development 0 December 2, 2010 16:45
Is there a windows compile of Gumband 2.3.2 floating around? BlackFlame Variants 8 February 12, 2010 01:16


All times are GMT +1. The time now is 00:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.