mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
https://kyne.au/~mark/software/lua-cjson.php
MIT License
924 stars 474 forks source link

error loading module cjson.safe #55

Open rayenmessaoudi opened 6 years ago

rayenmessaoudi commented 6 years ago

i m trying to import the requests library but i got this error

error loading module 'cjson.safe' from file '/usr/local/lib/lua/5.2/cjson.so': /usr/local/lib/lua/5.2/cjson.so: undefined symbol: lua_objlen

any help ?

ignacio commented 6 years ago

Check the answer here: https://github.com/mpx/lua-cjson/issues/54 I think it also applies to you.

dauuricus commented 3 years ago

i m looking for the solution. this case is Arm7.Amazon FireHD 10 : Tremux

u0_a185@localhost ~/luatest> luarocks install lua-cjson STDCPP_LIBDIR=/system/lib/
Installing https://luarocks.org/lua-cjson-2.1.0.6-1.src.rock

gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c lua_cjson.c -o lua_cjson.o
lua_cjson.c:743:19: warning: implicit declaration of function 'lua_objlen' is invalid in C99 [-Wimplicit-function-declaration]
            len = lua_objlen(l, -1);
                  ^
1 warning generated.
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c strbuf.c -o strbuf.o
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c fpconv.c -o fpconv.o
gcc -shared -o cjson.so lua_cjson.o strbuf.o fpconv.o
lua-cjson 2.1.0.6-1 is now installed in /data/data/com.termux/files/home/luatest/./lua_modules (license: MIT)

Missing dependencies for http 0.4-0:
   cqueues >= 20161214 (not installed)
u0_a185@localhost ~/luatest> lua test_requests.lua
lua: error loading module 'cjson.safe' from file '/data/data/com.termux/files/usr/lib/lua/5.3/cjson.so':
        dlopen failed: cannot locate symbol "floor" referenced by "/data/data/com.termux/files/usr/lib/lua/5.3/cjson.so"...
stack traceback:
        [C]: in ?
        [C]: in function 'require'
        /data/data/com.termux/files/usr/share/lua/5.3/requests.lua:7: in main chunk
        [C]: in function 'require'
        test_requests.lua:5: in main chunk
        [C]: in ?