ubuntu 18.04安装配置lua

得学会用Lua,先安装吧,在http://www.lua.org/home.html上下载了5.3.5

tar zxf lua-5.3.5.tar.gz
~/Downloads/sourceCode$ cd lua-5.3.5/
~/Downloads/sourceCode/lua-5.3.5$ ls
doc  Makefile  README  src
~/Downloads/sourceCode/lua-5.3.5$ make linux test
cd src && make linux
make[1]: 进入目录“/home/Downloads/sourceCode/lua-5.3.5/src”
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: 进入目录“/home/Downloads/sourceCode/lua-5.3.5/src”
lua.c:82:10: fatal error: readline/readline.h: 没有那个文件或目录
 #include
          ^~~~~~~~~~~~~~~~~~~~~

有的网友安装了好几个包yum install libtermcap-devel ncurses-devel libevent-devel readline-devel

我上ubuntu上查了下,https://packages.ubuntu.com/bionic/libreadline-dev

sudo apt-get install libreadline-dev

我这边只需要安装libreadline-dev就够了

然后make install

~/Downloads/sourceCode/lua-5.3.5$ lua -v
Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio

http://developer.51cto.com/art/201312/422959.htm Lua简明教程

https://www.runoob.com/lua/lua-tutorial.html Lua 教程

 

 

你可能感兴趣的:(Lua)