curl -R -O http://www.lua.org/ftp/lua-5.3.3.tar.gz tar zxf lua-5.3.3.tar.gz cd lua-5.3.3 make linux test
安装make
编译过程如果提示以下信息则需要先安装make:
1 2 3 4 5
# make linux test The program 'make' can be found in the following packages: * make * make-guile Try: apt install <selected package>
安装make
1
# apt-get install make
安装gcc
编译过程提示以下信息则需要安装gcc:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# make linux test cd src && make linux make[1]: Entering directory '/root/lua/lua-5.3.3/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" make[2]: Entering directory '/root/lua/lua-5.3.3/src' gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lapi.o lapi.c make[2]: gcc: Command not found <builtin>: recipe for target 'lapi.o' failed make[2]: *** [lapi.o] Error 127 make[2]: Leaving directory '/root/lua/lua-5.3.3/src' Makefile:110: recipe for target 'linux' failed make[1]: *** [linux] Error 2 make[1]: Leaving directory '/root/lua/lua-5.3.3/src' Makefile:55: recipe for target 'linux' failed make: *** [linux] Error 2
安装gcc:
1
# apt-get install gcc
安装gcc过程提示以下信息:
1 2
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/b/binutils/binutils_2.26.1-1ubuntu1~16.04_amd64.deb 404 Not Found [IP: 115.28.122.210 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
先更新安装源:
1
# apt-get update
再次安装gcc成功。
安装libreadline-dev
编译过程提示以下信息则需要安装libreadline-dev:
1 2
lua.c:80:31: fatal error: readline/readline.h: No such file or directory compilation terminated.