Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error loading module cjson.safe #55

Open
rayenmessaoudi opened this issue Apr 30, 2018 · 2 comments
Open

error loading module cjson.safe #55

rayenmessaoudi opened this issue Apr 30, 2018 · 2 comments

Comments

@rayenmessaoudi
Copy link

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
Copy link

ignacio commented Apr 30, 2018

Check the answer here: #54
I think it also applies to you.

@dauuricus
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants