Compile and use boost for Android NDK R10e

前端 未结 5 625
面向向阳花
面向向阳花 2020-12-25 14:21

How do I compile and use Boost for the Android NDK? I\'ve tried everything I\'ve found online, from Boost for Android to compiling it myself with the bjam file. However, I d

5条回答
  •  难免孤独
    2020-12-25 15:09

    I only managed to build with 10d. Cross compiling Linux->Android using Boost for Android worked straight away with that.

    To download a slightly outdated ndk, as not all ndk are immediately supported by Boost for Android, you can use this guide: Where do I find old versions of Android NDK?

    Note: I also wanted to specify the toolchain. I had to do it in 2 places:

    1. In build-android.sh, just after the line mentioned here above:

      TOOLCHAIN=${TOOLCHAIN:-arm-linux-androideabi-4.9}

    2. In the command line

      bash build-android.sh [ndk location] --toolchain=arm-linux-androideabi-4.9

    In fact, it worked better when I specified exactly which boost components I wanted with --with-libraries=[comma separated list].

    If instead I would build everything, I would get:

    ...failed updating 38 targets...

    ...skipped 6 targets...

    ...updated 10568 targets...

    ERROR: Failed to build boost for android!

    Done!

提交回复
热议问题