Closed
Description
I got this error when including Lua in the compilation:
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -DPCRE_HAVE_JIT -DWITH_LUA -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT engine/libmodsecurity_la-lua.lo -MD -MP -MF engine/.deps/libmodsecurity_la-lua.Tpo -c -o engine/libmodsecurity_la-lua.lo `test -f 'engine/lua.cc' || echo './'`engine/lua.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -DPCRE_HAVE_JIT -DWITH_LUA -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT engine/libmodsecurity_la-lua.lo -MD -MP -MF engine/.deps/libmodsecurity_la-lua.Tpo -c engine/lua.cc -fPIC -DPIC -o engine/.libs/libmodsecurity_la-lua.o
engine/lua.cc: In member function 'bool modsecurity::engine::Lua::load(std::string, std::string*)':
engine/lua.cc:86:75: error: too many arguments to function 'int lua_dump(lua_State*, lua_Writer, void*)'
if (lua_dump(L, Lua::blob_keeper, reinterpret_cast<void *>(&m_blob), 0)) {
^
In file included from /usr/include/lua.hpp:6:0,
from ../src/engine/lua.h:17,
from engine/lua.cc:17:
/usr/include/lua.h:207:14: note: declared here
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
^
engine/lua.cc: In member function 'int modsecurity::engine::Lua::run(modsecurity::Transaction*)':
engine/lua.cc:136:34: error: 'luaL_setfuncs' was not declared in this scope
luaL_setfuncs(L, mscLuaLib, 0);
^
engine/lua.cc:140:13: error: too many arguments to function 'int lua_load(lua_State*, lua_Reader, void*, const char*)'
NULL);
^
In file included from /usr/include/lua.hpp:6:0,
from ../src/engine/lua.h:17,
from engine/lua.cc:17:
/usr/include/lua.h:204:16: note: declared here
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
^
engine/lua.cc:141:15: error: 'LUA_OK' was not declared in this scope
if (rc != LUA_OK) {
^
engine/lua.cc:151:18: error: 'LUA_ERRGCMM' was not declared in this scope
case LUA_ERRGCMM:
^
engine/lua.cc: In static member function 'static std::string modsecurity::engine::Lua::applyTransformations(lua_State*, modsecurity::Transaction*, int, std::string)':
engine/lua.cc:364:37: error: 'lua_rawlen' was not declared in this scope
int i, n = lua_rawlen(L, idx);
^
make[3]: *** [engine/libmodsecurity_la-lua.lo] Error 1
Dependencies
$ rpm -qa|grep lua
lua-5.1.4-15.el7.x86_64
lua-devel-5.1.4-15.el7.x86_64
rpm -qa|grep gcc
gcc-c++-4.8.5-16.el7.x86_64
gcc-4.8.5-16.el7.x86_64
libgcc-4.8.5-16.el7.x86_64