行云

行至水穷处,坐看云起时。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

NDK编译C++,提示找不到头文件

error: fstream: No such file or directory
error: set: No such file or directory
error: string: No such file or directory
解决办法
在所在目录,新建文件Application.mk,添加 APP_STL := gnustl_static。
与STL相关的错误
1 异常相关的错误
error: exception handling disabled, use -fexceptions to enable。
2 某些STL函数找不到
undefined reference to `__cxa_end_cleanup'

undefined reference to `__cxa_begin_catch'
undefined reference to `__cxa_end_catch'
undefined reference to `__cxa_get_exception_ptr'

可以参考这里:http://blog.csdn.net/andyhuabing/article/details/8591459

动态库编译正常include $(BUILD_SHARED_LIBRARY),改成静态库不编译include $(BUILD_STATIC_LIBRARY)
这是因为缺少Application.mk文件
解决方法:在<project>\jni\目录下添加一个Application.mk文件,里面写上一行代码: 
APP_MODULES := libexample
注意:libexample的名字要与Android.mk中LOCAL_MODULE=example的名字相同





posted on 2013-03-28 17:37  windflying  阅读(7388)  评论(0编辑  收藏  举报