Compiling C library for android, but no symbols found

后端 未结 2 446
迷失自我
迷失自我 2021-01-14 10:09

I am trying to compile a simple C library for android, but the resulting library doesn\'t contain any symbols/objects! I am checking the library using nm comman

2条回答
  •  醉梦人生
    2021-01-14 10:50

    I got similar issue. You can workaround with a custom build so that -lotherlib gets passed as final argument. For example:

    $ /path/to/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc \
    --sysroot=/path/to/platforms/android-19/arch-arm \
    -L/usr/local/src/lua-5.1.5/src -shared -lm -o mylibrary.so milibrary.o \
    -lotherlib
    

    I'm not a C expert so this took me days to figure out :P, not sure why -l should go at the very end...

提交回复
热议问题