001-lua在Ubuntu 16.04 安装
2018-01-31 本文已影响164人
霄峰
lua 官方网站:https://www.lua.org
- 下载&安装:
curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz
tar zxf lua-5.3.4.tar.gz
cd lua-5.3.4
sudo make linux test [这一步有可能会报错,如果有报错下面有解决方法]
sudo make install
- 在
make linux test
后报错:
cd src && make linux
make[1]: Entering directory '/home/scort/lua-5.3.4/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory '/home/scort/lua-5.3.4/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c
lua.c:82:31: fatal error: readline/readline.h: 没有那个文件或目录
compilation terminated.
<builtin>: recipe for target 'lua.o' failed
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory '/home/scort/lua-5.3.4/src'
Makefile:110: recipe for target 'linux' failed
make[1]: *** [linux] Error 2
make[1]: Leaving directory '/home/scort/lua-5.3.4/src'
Makefile:55: recipe for target 'linux' failed
make: *** [linux] Error 2
解决方法:
sudo apt-get install libreadline-dev