要编译的项目有三个:Lua, ToLua,lfs(luafilesystem)
Lua编译
- 到网站https://www.lua.org/ftp/下载lua代码,github上的lua源码编译脚本不完善,很大的可能编译不成功,不想花时间研究的还是选择下载源码包吧,因要与tolua配合使用,之前使用的是5.3.5,这次还是下载5.3.5版
- 解压代码,进入解压出来的目录,执行make linux,报错unkown <readline/readline.h>
- 执行yum install readline-devel,安装readline库
- 再次执行make linux
- 执行make install 安装,否则后面编译tolua会找不到lua头文件
- 编译成功
ToLua编译
- 从地址https://hub.fastgit.org/LuaDist/tolua.git clone源码
- 进入tolua目录,执行make,报错:
In file included from /usr/local/include/lua.h:16:0,
from ../../include/tolua.h:33,
from tolua_event.c:19:
/usr/local/include/luaconf.h:581:2: 错误:#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for detai