Page 1 of 1

Help getting crawl to build

PostPosted: Thursday, 16th April 2015, 02:43
by XNoize
I wanted to try and create some new species to play as so I downloaded the source code and am trying to build my code.

I am using cygwin to build, but I'm running into some errors. Here is the error message:
----------------------------------------------------------------------------
cat: util/release_ver: No such file or directory
* If you experience any problems building Crawl, please take a second look
* at INSTALL.txt: the solution to your problem just might be in there!
* Need to build contribs: pcre lua/src sqlite
make[1]: Entering directory '/cygdrive/c/Users/Joseph/Documents/crawl-master/crawl-master/crawl-ref/source/contrib'
**********************************************************

The 'pcre' directory exists, but the Makefile is missing!
Did 'git submodule update' work properly?
(It's probably better to install all native dependencies instead.)

**********************************************************
Makefile:22: recipe for target 'pcre' failed
make[1]: *** [pcre] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Joseph/Documents/crawl-master/crawl-master/crawl-ref/source/contrib'
Makefile:1585: recipe for target '.contrib-libs' failed
make: *** [.contrib-libs] Error 2

------------------------------------------------------------------------------------
It looks to me like some directories/files are missing, could anyone give me some advice?

Re: Help getting crawl to build

PostPosted: Thursday, 16th April 2015, 04:03
by Siegurt
Looks like you're missing the submodules.

Try:
git submodule update

Re: Help getting crawl to build

PostPosted: Thursday, 16th April 2015, 06:09
by XNoize
Siegurt wrote:Looks like you're missing the submodules.

Try:
git submodule update


ok did that, looks like the firewall is blocking git though. I will try again when I can use different wifi.

Re: Help getting crawl to build

PostPosted: Thursday, 16th April 2015, 20:19
by XNoize
Success!

Unfortunately, while crawl starts building fine, I have run into several errors with the to_string() or fileno() functions. For example:

-------------------------------------------------------------
files.cc: In function ‘time_t file_modtime(FILE*)’:
files.cc:304:23: error: ‘fileno’ was not declared in this scope
if (fstat(fileno(f), &filestat))
-------------------------------------------------------------

Upon doing some googling, it appears that this problem can be caused if C++11 support is not enabled. Could anyone give me some advice on how to do this?

Re: Help getting crawl to build

PostPosted: Friday, 17th April 2015, 18:17
by XNoize
Ended up fixing the problem by changing the -std=c++11 to -std=gnu++0x in the makefile, im told -std=gnu++11 should work as well (I have no idea what the difference is). this fixed the fileno errors, I fixed the to_string errors by reverting to the make_stringf("%d", n) function in place of it as it was mentioned in the git repository.

Re: Help getting crawl to build

PostPosted: Saturday, 18th April 2015, 01:09
by neil
XNoize wrote:Ended up fixing the problem by changing the -std=c++11 to -std=gnu++0x in the makefile, im told -std=gnu++11 should work as well (I have no idea what the difference is). this fixed the fileno errors, I fixed the to_string errors by reverting to the make_stringf("%d", n) function in place of it as it was mentioned in the git repository.


Ah, IIRC this is because the standard library that Cygwin uses fails to define POSIX- (Unix-) specific things in standards-compliant mode. This is an intentional behaviour.

Does it help if you go back to compiling with -std=c++11 but put this line at the top of AppHdr.h?

  Code:
#define _POSIX_C_SOURCE 1