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
一般会出现编译错误:
lua.c:82:31: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^
compilation terminated.
<builtin>: recipe for target 'lua.o' failed
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory '/home/zc/Downloads/lua-5.3.4/src'
Makefile:110: recipe for target 'linux' failed
make[1]: *** [linux] Error 2
make[1]: Leaving directory '/home/zc/Downloads/lua-5.3.4/src'
Makefile:55: recipe for target 'linux' failed
make: *** [linux] Error 2
错误解决:
sudo apt-get install libreadline-dev
创建连接 sudo ln -s ~/lua-5.3.4/src/lua /usr/bin/lua