Tencent / xLua

xLua is a lua programming solution for C# ( Unity, .Net, Mono) , it supports android, ios, windows, linux, osx, etc.
Other
9.42k stars 2.45k forks source link

WSL下使用make_android_lua54.sh编译失败,NDK=r23b #1172

Open Run0812 opened 1 week ago

Run0812 commented 1 week ago

lmathlib.c中使用了log2函数,需要在Android API >= 18的情况下 libm.so中才存在此符号 但是make_android_lua54.sh中是指定了API等级 android-18

也许是我使用的NDK版本的cmake参数不支持ANDROID_NATIVE_API_LEVEL了? 个人的解决方法是多传一个 -DANDROID_PLATFORM=${API} 来指定API等级

[ 2%] Linking C shared library libxlua.so ld: error: undefined symbol: log2

referenced by lmathlib.c CMakeFiles/xlua.dir/lua-5.4.1/src/lmathlib.c.o:(math_log) did you mean: logb defined in: /home/myname/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/libm.so clang: error: linker command failed with exit code 1 (use -v to see invocation)

chexiongsheng commented 4 days ago

我用r21b