一、安装
wget http://www.lua.org/ftp/lua-5.3.4.tar.gz
tar -zxvf lua-5.3.4.tar.gz
cd lua-5.3.4
make linux test
make install
查看是否安装成功:
ma@ubuntu:/data/code$ lua -v
Lua 5.3.4 Copyright (C) 1994-2017 Lua.org, PUC-Rio
二、卸载
进入lua源码目录:
make uninstall
三、遇到的问题
[ma@localhost lua-5.3.4]$ make linux test
cd src && make linux
make[1]: Entering directory `/data/software/lua-5.3.4/src''
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/data/software/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: No such file or directory
#include <readline/readline.h>
^
compilation terminated.
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory `/data/software/lua-5.3.4/src''
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/data/software/lua-5.3.4/src''
make: *** [linux] Error 2
解决方案
# centos
yum install readline-devel
# debian
apt-get install libreadline-dev
此处评论已关闭