openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.27k stars 2.03k forks source link

compile error with nginx 1.0.6 on red hat X64 #82

Closed sziceboy closed 12 years ago

sziceboy commented 12 years ago

The following error happens when building lua-nginx-module with nginx 1.0.5:

../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c: 在函数‘ngx_http_lua_new_thread’中: ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:191: 错误:‘LUA_GLOBALSINDEX’未声明(在此函数内第一次使用) ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:191: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其 ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:191: 错误:所在的函数内也只报告一次。) ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c: 在函数‘ngx_http_lua_del_thread’中: ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:253: 错误:提供给函数‘lua_resume’的实参太少 ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c: 在函数‘init_ngx_lua_globals’中: ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:524: 错误:‘LUA_GLOBALSINDEX’未声明(在此函数内第一次使用) ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c: 在函数‘ngx_http_lua_run_thread’中: ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:789: 警告:传递‘lua_resume’的第 2 个参数时将整数赋给指针,未作类型转换 /usr/local/lua5.2/include/lua.h:269: 附注:需要类型‘struct luaState ’,但实参的类型为‘int’ ../chaoslawful-lua-nginx-module-a95e02f//src/ngx_http_lua_util.c:789: 错误:提供给函数‘luaresume’的实参太少 make[1]: ** [objs/addon/src/ngx_http_lua_util.o] 错误 1 make[1]: * 正在等待未完成的任务.... make[1]: Leaving directory `/root/lnmp/lua_nginx_module/nginx-1.0.6' make: * [build] 错误 2

[root@XEN207_3DS_WEB_75 nginx-1.0.6]# rpm -qa | grep gcc gcc-gfortran-4.4.4-13.el6.x86_64 gcc-4.4.4-13.el6.x86_64 libgcc-4.4.4-13.el6.x86_64 gcc-c++-4.4.4-13.el6.x86_64

agentzh commented 12 years ago

ngx_lua does not support Lua 5.2. Only Lua 5.1.x and LuaJIT 2.0 are supported. See http://wiki.nginx.org/HttpLuaModule#Installation