lua-cjson icon indicating copy to clipboard operation
lua-cjson copied to clipboard

cjson with luajit2.1

Open jney opened this issue 8 years ago • 3 comments

Hi. I've got problems installing cjson with luajit2.1:

lua_cjson.c:1298:13: error: static declaration of ‘luaL_setfuncs’ follows non-static declaration
 static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
             ^
In file included from lua_cjson.c:44:0:
/home/travis/build/OystParis/lua-nats/install/lua/include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of ‘luaL_setfuncs’ was here
 LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
                  ^
Error: Failed installing dependency: https://luarocks.org/lua-cjson-2.1.0-1.src.rock - Build error: Failed compiling object lua_cjson.o

do you have any idea?

jney avatar May 23 '17 14:05 jney

#40 Possible duplication?

concatime avatar May 27 '17 18:05 concatime

I found the same problem (and #40 don't look like a duplicate).

You are using branch v2.1 from luajit and you have been bitten by this change: https://github.com/LuaJIT/LuaJIT/commit/de97b9d52bbc42effeaf1180764053a912526873#diff-fa6206d4c14ef1b0f7109e58a6a78c19 which add luaL_setfuncs lua-cjson add it too here: https://github.com/mpx/lua-cjson/blob/master/lua_cjson.c#L1312 The both have different signature (static or not)

alkino avatar Jul 31 '18 13:07 alkino

Learn more here: https://github.com/LuaJIT/LuaJIT/issues/325

alkino avatar Jul 31 '18 13:07 alkino