最近使用ndk时,
#include <string>
ndkbuild编译后报错:fatal error: string: No such file or directory
#include <string.h>
std::string 编译报错:error: 'string' is not a member of 'std'
解决办法:
需要让Android NDK支持STL
Application.mk中加入:
APP_STL := stlport_static
如下:
#include <string>
std::string s;
或者使用命名空间 using namespace std;