主要命令
curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make linux test
make install
当你在make linux test可能会出现以下错误
lua.c:80:10: fatal error: readline/readline.h: No such file or directory
80 | #include <readline/readline.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [: lua.o] Error 1
make[2]: Leaving directory ‘/home/moens/Documents/lua-5.3.0/src’
make[1]: *** [Makefile:110: linux] Error 2
make[1]: Leaving directory ‘/home/moens/Documents/lua-5.3.0/src’
make: *** [Makefile:55: linux] Error 2
原因:缺少libreadline-dev
运行 sudo apt-get install libreadline-dev
即可解决
最终安装如果出现Permission denied
记得在命令前面加sudo
;