Help compiling NetHack 3.6.7 on Ubuntu?
I am attempting to figure out how to compile NetHack 3.6.7 myself so that I can apply patches from the patch database, but I'm having a lot of trouble getting it to work. I have a Windows machine with a working Linux virtual machine on it, but following the instructions in the included Install files and on the Compiling wiki page has just run into errors I can't figure out how to fix. After downloading and extracting NetHack 3.6.7 on the virtual machine, I have run the following commands, beginning in the $Top directory:
$ cd sys/unix
$ sh setup.sh hints/linux
$ cd ../..
$ make all
which yielded the following error:
( cd src ; make )
make[1]: Entering directory '/home/wildfire/Downloads/nethack-3.6.0/src'
touch ../src/config.h-t
cc -g -O -I../include -DNOTPARMDECL -DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" -DDLB -DSYSCF -DSYSCF_FILE=\"/home/wildfire/nh/install/games/lib/nethackdir/sysconf\" -DSECURE -DHACKDIR=\"/home/wildfire/nh/install/games/lib/nethackdir\" -c monst.c
In file included from ../include/unixconf.h:290,
from ../include/global.h:115,
from ../include/config.h:458,
from monst.c:5:
/usr/include/stdlib.h:605:13: error: conflicting types for ‘srand48’; have ‘void(long int)’
605 | extern void srand48 (long int __seedval) __THROW;
| ^~~~~~~
In file included from ../include/unixconf.h:287:
../include/system.h:94:8: note: previous declaration of ‘srand48’ with type ‘void(void)’
94 | E void srand48();
| ^~~~~~~
In file included from ../include/unixconf.h:291:
/usr/include/unistd.h:464:21: error: conflicting types for ‘sleep’; have ‘unsigned int(unsigned int)’
464 | extern unsigned int sleep (unsigned int __seconds);
| ^~~~~
../include/system.h:354:12: note: previous declaration of ‘sleep’ with type ‘unsigned int(void)’
354 | E unsigned sleep();
| ^~~~~
make[1]: *** [Makefile:528: monst.o] Error 1
make[1]: Leaving directory '/home/wildfire/Downloads/nethack-3.6.0/src'
make: *** [Makefile:145: nethack] Error 2
I already tried doing a completely fresh install, and I'm getting the same error. How do I fix this?