[英]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.