为android arm架构构建boost时出错

时间:2018-02-15 11:36:07

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

为什么我只在构建一些特定的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&使用工具集铿锵..

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使用:android-ndk-r16b,也试过android-ndk-r15c

使用本网站作为参考:

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

为什么会出现这些错误?

1 个答案:

答案 0 :(得分:0)

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

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

相关问题