nethack下载地址 http://www.nethack.org/v360/download-src.html
安装参考教程 https://tieba.baidu.com/p/4183207534?red_tag=0200787513
http://www.bkjia.com/Linuxjc/1090400.html#comment
http://blog.csdn.net/hao119119/article/details/49123049
游戏操作教程 https://iakwings.github.io/test/posts/nethack-slashem/
https://tieba.baidu.com/p/1438247556?red_tag=2714749698
具体操作:1 准备工作 安装flex yacc(用bison代替) libncurses5-dev
sudo apt-get install flex sudo apt-get install bison sudo apt-get install libncurses5-dev
2 修改配置文件 编辑include/unixconf.h文件。将这行代码:
/* #define LINUX */
修改为这样的形式:
#define LINUX
3 安装
cd /home/leon/APP/nethack/nethack-3.6.0/sys/unix sh setup.sh hints/linux #不知道啥意思
cd /home/leon/APP/nethack/nethack-3.6.0 #由上一个目录可以直接cd ../.. make all su root make install
安装完成 没有报错 发现不会进入游戏 什么情况
leon@leon-Lenovo-TianYi-100-14IBD:~$ nethack 程序 'nethack' 已包含在下列软件包中: * nethack-console * nethack-x11 请尝试:sudo apt install <选定的软件包>
根据提示安装就可以了
sudo apt instal nethack-console
把编译过程复制在这里 可能有一天会看得懂~
leon@leon-Lenovo-TianYi-100-14IBD:~/APP/nethack/nethack-3.6.0$ make all ( cd src ; make ) make[1]: Entering directory '/home/leon/APP/nethack/nethack-3.6.0/src' cc -g -O -I../include -DNOTPARMDECL -DCOMPRESS="/bin/gzip" -DCOMPRESS_EXTENSION=".gz" -DDLB -DSYSCF -DSYSCF_FILE="/home/leon/nh/install/games/lib/nethackdir/sysconf" -DSECURE -DHACKDIR="/home/leon/nh/install/games/lib/nethackdir" -c ../sys/share/unixtty.c ../sys/share/unixtty.c: In function ‘linux_mapon’: ../sys/share/unixtty.c:412:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(1, "