mpx / lua-cjson

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

dlopen failed: cannot locate symbol "floor" referenced by ... #77

Open dauuricus opened 3 years ago

dauuricus commented 3 years ago

lua-cjson 2.1.0-1

using termux pkg luarocks on armv7a android

u0_a185@localhost ~/luatest> lua -e "require 'cjson'"
lua: error loading module 'cjson' 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'
(command line):1: in main chunk
[C]: in ?
jwzl commented 3 years ago

I alse meeted, and how to fix it ? thanks!

dosimple commented 1 year ago

Adding -lm to the linking step solves the problem:

gcc -shared -lm -o cjson.so lua_cjson.o strbuf.o fpconv.o