NDK: How to include Prebuilt Shared Library Regardless of Architecture

前端 未结 5 1627
孤街浪徒
孤街浪徒 2020-12-13 10:45

I am working on porting Box2D to learn a little more about android porting.

I can get the project compiling and I see the following....

ls libs/

5条回答
  •  醉梦人生
    2020-12-13 11:14

    Android NDK official hello-libs CMake example

    https://github.com/googlesamples/android-ndk/tree/840858984e1bb8a7fab37c1b7c571efbe7d6eb75/hello-libs

    The key thing is to pack all versions of the .so that you care about, e.g.:

    • distribution/gperf/lib/arm64-v8a/libgperf.so
    • distribution/gperf/lib/x86_64/libgperf.so

    and then pick the right one on CMake with: ${ANDROID_ABI}.

    I have further explained that example at: How to link a prebuilt shared Library to an Android NDK project?

提交回复
热议问题