为 Android NDK R10e 编译和使用 boost [英] Compile and use boost for Android NDK R10e

查看:18
本文介绍了为 Android NDK R10e 编译和使用 boost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为 Android NDK 编译和使用 Boost?我已经尝试了我在网上找到的所有内容,从 Boost for Android 到自己编译与 bjam 文件.但是,我没有成功.当我尝试用 bjam 编译它时,我收到以下错误:

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

有人在 Android NDK R10e 上成功使用过 Boost 吗?

Has anyone successfully used Boost with Android NDK R10e?

当我可以编译它时,我应该如何在我的 Android 应用项目中使用它?

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

推荐答案

我们设法为 NDKr10d 编译了它.NDKr10e 应该是一样的.project-config.bjam 应该指向 NDK 中的 gcc 编译器.我们的看起来像这样:

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 ; 

然后用b2编译,告诉android的路径包括:

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

b2 --reconfigure <your options>
    toolset=gcc-arm
    include=<ndk folder>sourcescxx-stlgnu-libstdc++4.9include
    include=<ndk folder>sourcescxx-stlgnu-libstdc++4.9libs<target platform>include
    include=<ndk folder>platforms<android api version>arch-armusrinclude
    install --libdir=stagelib<target platform>

我们即将迁移到 ndkr10e.你能告诉boost是否仍然可以使用它吗?:)

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

这篇关于为 Android NDK R10e 编译和使用 boost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆