Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile and use boost for Android NDK R10e

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 do not succeed. When I try compiling it with bjam, I get the following error:

error: toolset gcc initialization:

error: version 'androidR10e' requested but 'g++-androidR10e' not found and version '4.2.1' of default 'g++' does not match
error: initialized from /path/to/android-ndk-r10e/sources/boost/tools/build/v2/user-config.jam:86

Has anyone successfully used Boost with Android NDK R10e?

And when I can compile it, how should I do to use it in my Android app project?

like image 574
BSod Avatar asked May 27 '15 19:05

BSod


1 Answers

We managed to compile it for NDKr10d. It should be the same for NDKr10e. The project-config.bjam should point to the gcc compiler from the NDK. Ours looks like this :

import option ; 
using gcc : arm : D:\\android\\ndk\\toolchains\\arm-linux-androideabi-4.9\\prebuilt\\windows-x86_64\\bin\\arm-linux-androideabi-g++.exe ; 
option.set keep-going : false ; 

Then just compile with b2, telling paths to android includes :

b2 --reconfigure <your options>
    toolset=gcc-arm
    include=<ndk folder>\sources\cxx-stl\gnu-libstdc++\4.9\include
    include=<ndk folder>\sources\cxx-stl\gnu-libstdc++\4.9\libs\<target platform>\include
    include=<ndk folder>\platforms\<android api version>\arch-arm\usr\include
    install --libdir=stage\lib\<target platform>

We're about to move to ndkr10e. Could you tell if boost still works with it ? :)

like image 164
brainsandwich Avatar answered Nov 08 '22 13:11

brainsandwich