[英]some c++ include file in Android NDK does not work
我正在使用android JNI使用一些c ++代码。 但是我应该如何解决android jni无法识别c ++版本的一些include文件中的include文件的问题:
#include <string>
#include <iostream>
#include <fstream>
因此某些读取文件的代码无法使用
例如: istream ,getline(), string
,应如何找到替代解决方案?
以及一些传递函数, std::stoull( std::wstring& ), atof, and so on
,这些对我的模块来说微不足道,
有没有类似的经历?
您需要定义一个适当的C ++运行时以在Application.mk
使用。
例如:
APP_STL := gnustl_static
引用docs/CPLUSPLUS-SUPPORT.html
:
若要选择要使用的运行时,
APP_STL
在Application.mkAPP_STL
定义为以下值之一:
系统->使用默认的最小系统C ++运行时库。
gabi ++ _ static->将GAbi ++运行时用作静态库。
gabi ++ _ shared->将GAbi ++运行时用作共享库。
stlport_static->将STLport运行时用作静态库。
stlport_shared->将STLport运行时用作共享库。
gnustl_static->将GNU STL用作静态库。
gnustl_shared->将GNU STL用作共享库。
如果不指定使用哪个默认值,则默认值为system
,它仅提供以下STL标头:
cassert cctype cerrno cfloat climits cmath csetjmp csignal
cstddef cstdint cstdio cstdlib cstring ctime cwchar new stl_pair.h
typeinfo实用程序
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.