p0pr0ck5 / lua-resty-waf

High-performance WAF built on the OpenResty stack
GNU General Public License v3.0
1.28k stars 305 forks source link

make: *** [lua-aho-corasick] Error 2 bug #241

Closed duwenjun closed 7 years ago

duwenjun commented 7 years ago

Hi There, Im getting the following error when trying to installing Lua-resty-waf that using "luarocks install lua-resty-waf"

make[1]: Entering directory /tmp/luarocks_lua-resty-waf-0.8.2-2-khernB/lua-resty-waf/lua-aho-corasick'
mkdir build_so
g++ ac_fast.cxx -c -fvisibility=hidden -Wall -msse2 -msse3 -msse4.1 -O3    -fPIC -I/usr/include/lua5.1 -MMD -o build_so/ac_fast.o
g++ ac_slow.cxx -c -fvisibility=hidden -Wall -msse2 -msse3 -msse4.1 -O3    -fPIC -I/usr/include/lua5.1 -MMD -o build_so/ac_slow.o
g++ ac.cxx -c -fvisibility=hidden -Wall -msse2 -msse3 -msse4.1 -O3    -fPIC -I/usr/include/lua5.1 -MMD -o build_so/ac.o
g++ build_so/ac_fast.o build_so/ac_slow.o build_so/ac.o -shared -Wl,-soname=libac.so -fvisibility=hidden -Wall -msse2 -msse3 -msse4.1 -O3    -o libac.so
cat build_so/ac_fast.d build_so/ac_slow.d build_so/ac.d > c_so_dep.txt
g++ ac_lua.cxx -c -fvisibility=hidden -Wall -msse2 -msse3 -msse4.1 -O3    -fPIC -I/usr/include/lua5.1 -MMD -o build_so/ac_lua.o
ac_lua.cxx:11:21: warning: lua.h: No such file or directory
ac_lua.cxx:12:25: warning: lauxlib.h: No such file or directory
ac_lua.cxx:170:6: error: #error "Don't know how to do it right"
ac_lua.cxx:24: error: expected ‘)’ before ‘*’ token
ac_lua.cxx:33: error: ISO C++ forbids declaration of ‘lua_State’ with no type
ac_lua.cxx:33: error: expected ‘;’ before ‘*’ token
ac_lua.cxx: In member function ‘virtual AC_Buffer* BufAlloc::alloc(int)’:
ac_lua.cxx:26: error: ‘_L’ was not declared in this scope
ac_lua.cxx:26: error: ‘lua_newuserdata’ was not declared in this scope
ac_lua.cxx: At global scope:
ac_lua.cxx:37: error: ‘lua_State’ was not declared in this scope
ac_lua.cxx:37: error: ‘L’ was not declared in this scope
ac_lua.cxx:37: error: expected primary-expression before ‘const’
ac_lua.cxx:38: error: expected primary-expression before ‘const’
ac_lua.cxx:38: error: initializer expression list treated as compound expression
ac_lua.cxx:38: error: expected ‘,’ or ‘;’ before ‘{’ token
ac_lua.cxx:20: warning: ‘tname’ defined but not used
ac_lua.cxx:37: warning: ‘_create_helper’ defined but not used
make[1]: *** [build_so/ac_lua.o] Error 1
make[1]: Leaving directory /tmp/luarocks_lua-resty-waf-0.8.2-2-khernB/lua-resty-waf/lua-aho-corasick'
make: *** [lua-aho-corasick] Error 2

Error: Build error: Failed building.

I'm hoping someone who can give me advice. Thanks.

p0pr0ck5 commented 7 years ago

Hi,

Apologies for the delayed response. Here is where your error lies:

ac_lua.cxx:11:21: warning: lua.h: No such file or directory
ac_lua.cxx:12:25: warning: lauxlib.h: No such file or directory

Please ensure that the Lua library header files are in your build path. This can typically be achieved by installing the dev package associated with Lua to your system (for example, liblua5.1-0-dev on ubuntu).

PS. I've reformatted your initial comment for readability. In the future please use some markdown to make console output readable :)

p0pr0ck5 commented 7 years ago

Closing after no reply. Please feel free to re-open if necessary.

yingshang commented 7 years ago

i have same issus,but i solve it. yum install lua-devel