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

Error using luarocks installation

Open hugeblank opened this issue 6 years ago • 3 comments

lua_cjson.c: In function ‘json_append_data’:
lua_cjson.c:743:19: warning: implicit declaration of function ‘lua_objlen’ [-Wimplicit-function-declaration]
             len = lua_objlen(l, -1);
                   ^~~~~~~~~~

I'm using lua 5.3, and according to the manual lua_objlen is a thing, so I don't see why this would error, but it does

hugeblank avatar Apr 27 '18 06:04 hugeblank

Check how your Lua installation was built. lua_objlen is only available if you compile Lua with certain compatibility flags: https://www.lua.org/source/5.3/luaconf.h.html

It was renamed to lua_rawlen in 5.2.

You need to rebuild with -DLUA_COMPAT_5_1

ignacio avatar Apr 27 '18 09:04 ignacio

@ignacio Thanks for the pointer! I'll be sure to try that when I get home, If it works I'll make sure to report back and close this issue.

hugeblank avatar Apr 27 '18 16:04 hugeblank

mark

tanhaipeng avatar Oct 12 '18 07:10 tanhaipeng