View Single Post
Old April 17, 2015, 07:18   #43
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 124
Dean Anderson is on a distinguished road
Quote:
Originally Posted by Nerdanel View Post
Cthangband doesn't compile on Linux. This is because Linux is case-sensitive (not just case-preserving), and most of the source files have been renamed to start with capital letters. Meanwhile all the makefiles and the includes in the source files all use uncapitalized versions of the filenames.

Also, makefile.org still uses the hellband name.

I'm now going to have to rename the files one by one...

EDIT TO ADD:

Having renamed the files, I now get the following error message:

Code:
$ make -f makefile.org
gcc -I/usr/X11R6/include -I/usr/include/ncurses -Wall -O2 -fno-strength-reduce -
pedantic -D"USE_X11" -D"USE_GCU" -D"USE_NCURSES"   -c -o z-util.o z-util.c
In file included from h-basic.h:16:0,
                 from z-util.h:6,
                 from z-util.c:5:
h-system.h:107:21: error: macro "strchr" requires 2 arguments, but only 1 given
 extern char *strchr();
                     ^
h-system.h:107:14: error: 'strchr' redeclared as different kind of symbol
 extern char *strchr();
              ^
<builtin>: recipe for target 'z-util.o' failed
make: *** [z-util.o] Error 1
So yes, it errors out when trying to compile the first file.
That doesn't surprise me at all. I've never seen a Linux version of Cthangband (I'm sure people have done them for their own use over the years, but no-one has ever sent me updated files back to stick in the "official" source code). And since I don't have Linux and never use makefiles these things just get copied from version to version and are usually woefully out of date.

I know that there are some funky #ifdef preprocessor commands throughout the code to deal with different platforms and it vaguely rings a bell that the redefinition of strchr is wrapped in them (I don't have the code in front of me to check), so the error you're getting with z-util is probably because they're set up wrongly, but again I've no experience of compiling on anything except Windows or DOS and these things are things that I inherited from the Zangband code 18 years ago and haven't touched since.
Dean Anderson is offline   Reply With Quote