Skip to content

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

Open

Description

@Run0812

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)

Activity

  1. chexiongsheng commented on Nov 13, 2024

    @chexiongsheng
    Collaborator

    我用r21b

  2. Run0812 commented on Nov 26, 2024

    @Run0812
    Author

    我用r21b

    因为unity 2022.3 tls的 ndk版本是r23b (23.1.7779620),所以我用了r23b。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions