ip2region
ip2region copied to clipboard
Lua_c can not complie and use in luajit2.0.4
gcc -O2 -Wall -fPIC -I ../c/ -I /usr/local/include/luajit-2.0/ ../c/ip2region.c lua_ip2region.c -fPIC -shared -o Ip2region.so
lua_ip2region.c: In function 'luaopen_Ip2region':
lua_ip2region.c:224:5: warning: implicit declaration of function 'luaL_setfuncs' [-Wimplicit-function-declaration]
luaL_setfuncs(L, ip2region_methods, 0);
^
after make install
local Ip2region = require "Ip2region";
then
> local Ip2region = require "Ip2region";
error loading module 'Ip2region' from file './Ip2region.so':
./Ip2region.so: undefined symbol: luaL_setfuncs
stack traceback:
[C]: at 0x0044b820
[C]: in function 'require'
stdin:1: in main chunk
[C]: at 0x00404a30
how can I resolve this error? Thanks.
看着像lua内核版本不对,找不到luaL_setfuncs函数,先用lua 5.2内核试试。