为 Android NDK 编译 Boost 库的子集
我的 Android 应用程序需要一个 boost 库,因此我设法编译了其中的大部分库。但是当我尝试编译文件系统组件时,我收到以下错误消息。
gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-android4.4.3/release/link-static/runtime-link-static/threading-multi/v2/src/v2_operations.o
libs\filesystem\v2\src\v2_operations.cpp:62:30:
error: sys/statvfs.h: No such file or directory
据我了解,这是因为Android NDK的gcc没有与statvfs.h
相关的部分。
我想知道的是,文件系统组件对于 boost-spirit 是否是必需的?当然,如果您知道如何解决该错误,那就完美了。
I needed one of boost libraries for my Android app so I managed to compile most of them. But when I am trying to compile filesystem component, I get following error message.
gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-android4.4.3/release/link-static/runtime-link-static/threading-multi/v2/src/v2_operations.o
libs\filesystem\v2\src\v2_operations.cpp:62:30:
error: sys/statvfs.h: No such file or directory
I understand that this is because Android NDK's gcc does not have the part related to statvfs.h
.
What I am wondering, is if filesystem component is necessary for boost-spirit? Of course, if you know how to resolve that error, that would be perfect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决你的编译错误
我还没有尝试过使用 Boost Filesystem,但它可能会起作用:
如果 Boost Spirit 需要 Boost Filesystem
根据 boost 手册 它是一个仅包含标题的模块。 :)
为什么 android 没有 statvfs?
根据其手册页,statvfs是POSIX,但 Linux(Android 是基于 Linux 的)不遵守它。以下引用适用:
Solving your compilation error
I haven't tried this with Boost Filesystem but it will probably work:
If Boost Spirit needs Boost Filesystem
According to boost manual it is a header-only module. :)
Why doesn’t android have statvfs?
According to its manpage, statvfs is for POSIX, but Linux (and Android is based on Linux) disobeys it. Following quotes applies: