lua.c:82:10: fatal error: readline/readline.h: No such file or directory #include <readline/readline.h>

make linux
cd src && make linux
make[1]: Entering directory `/root/lua/lua-5.3.2/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/root/lua/lua-5.3.2/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c
lua.c:80: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 `/root/lua/lua-5.3.2/src'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/root/lua/lua-5.3.2/src'
make: *** [linux] Error 2

解决方法:
缺少libreadline-dev依赖包
centos: yum install readline-devel
debian: apt-get install libreadline-dev

http://www.vcerror.com/?p=1786

 

# make linux
cd src && make linux
make[1]: Entering directory `/home/lua/lua-5.3.2/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/home/lua/lua-5.3.2/src'
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c
gcc -std=gnu99 -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline 
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o luac.o luac.c
gcc -std=gnu99 -o luac luac.o liblua.a -lm -Wl,-E -ldl -lreadline 
make[2]: Leaving directory `/home/lua/lua-5.3.2/src'
make[1]: Leaving directory `/home/lua/lua-5.3.2/src'

 

ubuntu中安装lua5.3

下载最新的lua5.3.1的tar包,下载地址:http://www.lua.org/ftp/,把下载的文件放到/usr/local/src/目录下。
然后输入以下命令:

tar zxf lua-5.3.1.tar.gz
cd lua-5.3.1
make linux test

则会自动安装好Lua解释文件,你会在src文件夹下发现多了几个文件。安装过程中可能会报错,没有readline什么的。解决办法:

sudo apt-get install libreadline6 libreadline6-dev
创建软连接,这样就可以随处用lua了。

ln -s /usr/local/src/lua5.3.3/src/lua /usr/bin/lua
这样安装就完成了,执行命令lua就可以使用了。
---------------------
作者:qq_16209077
来源:CSDN
原文:https://blog.csdn.net/qq_16209077/article/details/52950082
版权声明:本文为博主原创文章,转载请附上博文链接!

原文链接:

lua.c:80:31: fatal error: readline/readline.h: No such file or directory-云栖社区-阿里云  https://yq.aliyun.com/articles/270285 

ubuntu中安装lua5.3 - wonder - CSDN博客  https://blog.csdn.net/qq_16209077/article/details/52950082

001-lua在Ubuntu 16.04 安装 - 简书  https://www.jianshu.com/p/0ba41cf0403c

 

posted @ 2019-06-04 10:14  西伯利亚虎  阅读(1225)  评论(0编辑  收藏  举报

Permanence, perseverance and persistence in spite of all obstacles, discouragements and impossibilities: It is this, that in all things distinguishes the strong soul from the weak.