1833726 Members
2459 Online
110063 Solutions
New Discussion

Re: Compiling "nethack"

 
Doug Monroe
Advisor

Compiling "nethack"

For your daily dose of frivolity...

I'm trying to compile the roguelike game nethack v3.4.3 on my hp-ux 11.11 pa-risc system, with the ansi-c compiler. I've followed the instructions, and when I make it, I get:

# make
( cd src ; make )
cc -O -I../include -c monst.c
cc: "/usr/include/sys/unistd.h", line 164: error 1584: Inconsistent type declara
tion: "write".
cc: "/usr/include/sys/unistd.h", line 164: error 1711: Inconsistent parameter li
st declaration for "write".
cc: "/usr/include/sys/unistd.h", line 179: error 1584: Inconsistent type declara
tion: "fork".
cc: "/usr/include/sys/unistd.h", line 182: error 1584: Inconsistent type declara
tion: "getgid".
cc: "/usr/include/sys/unistd.h", line 184: error 1584: Inconsistent type declara
tion: "getpid".
cc: "/usr/include/sys/unistd.h", line 186: error 1584: Inconsistent type declara
tion: "getuid".
*** Error exit code 1

So, anything special I should be doing? I've had good luck compiling on other unix systems.

Thanks,

Doug
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: Compiling "nethack"

This means that a number of the system calls are defined in your application header files as being of one type (e.g. int) and in /usr/include/sys/unistd.h as being something else (e.g. uid_t). You might try changing the compiler option to something like -Ae, -Ac, -AC99. The default is -Aa (ANSI). Look at the header files and there will be a number of #ifdef's for the various models. You should be able to make some changes to your Makefile so that the source code and the machine machine architecture match.
If it ain't broke, I can fix that.
Doug Monroe
Advisor

Re: Compiling "nethack"

You put me on the right track.

It was trying to use POSIX declarations, I had to undefine "POSIX_TYPES" in a config file and it then compiled.

Thanks.