【问题标题】:Error while building boost for android arm architectures为 android arm 架构构建 boost 时出错
【发布时间】:2018-07-26 03:41:47
【问题描述】:

为什么只有在构建一些特定的 boost 库(如 arm 的文件系统)时才会出现这些错误?

error: no member named 'fgetpos' in the global namespace
error: no member named 'fsetpos' in the global namespace
error: no member named 'truncate' in the global namespace

'error' screenshot

使用来自 android ndk 的独立工具链。

gcc 版本: gcc (Ubuntu 6.0.1-0ubuntu1) 6.0.0 20160414(实验性)

使用boost boost_1_66_0也试过boost_1_64_0

sudo ./bootstrap.sh --with-libraries=filesystem cxxflags=-std=c++14

Boost.Build 引擎与工具集 gcc...

还尝试使用 -std=c++11 和使用工具集 clang..

user-config.jam 文件:

standaloneToolchains = /home/rahul/Android/Sdk/standalone_toolchains ;
using clang : arm : $(standaloneToolchains)/arm/bin/clang++ ;

构建库文件系统的命令:

./b2 -d+2 -j 2 --reconfigure cxxflags=-std=c++14 target-os=android toolset=clang-arm include=/home/rahul/Android/Sdk/standalone_toolchains/include/ c++/4.9.x link=static,shared variant=release threading=multi --prefix=/home/rahul/Android/Sdk/boost/arm install

./b2 -d+2 -j 2 --reconfigure cxxflags=-std=c++14 target-os=android toolset=clang-arm include=/home/rahul/Android/Sdk/standalone_toolchains/include/c++/4.9.x link=static,shared variant=release threading=multi --prefix=/home/rahul/Android/Sdk/boost/arm install

ndk used : android-ndk-r16b ,也试过 android-ndk-r15c

使用本网站作为参考:

https://sites.google.com/site/robdevelopertips/how-to-build-boost-1-64-0-for-androidenter link description here

为什么会出现这些错误?

【问题讨论】:

  • 运气好可以解决吗?

标签: boost android-ndk arm clang++ boost-filesystem


【解决方案1】:

您可以在 android API 24 之后通过工具链编译 boost。

奇怪的是 fgetpos 似乎是在 stdio.h 中定义的,即使对于早期的 android API 也是如此。 我猜在 stdio.h 中只有一个 fgetpos 声明 但是google的libc中没有定义(实现)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-10
    • 2018-09-13
    • 2015-03-07
    • 2017-09-17
    相关资源
    最近更新 更多