ndk c++11 编译的坑

代码如下

#include 
#include 
#include 
#include 
using namespace std;
void f()
{
	printf("exec f\n");
}
int TestCpp11()
{
	std::this_thread::sleep_for(std::chrono::seconds(10));
	auto fu = async(launch::async, f);
	return 0;
}
Application.mk中

APP_ABI := armeabi

怎么都编译不过,提示

jni/main.cpp: In function 'int TestCpp11()':
jni/main.cpp:17:34: error: invalid use of incomplete type 'class std::future'
  auto fu = async(launch::async, f);
                                  ^
In file included from jni/main.cpp:1:0:
D:/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.9/include/future:114:11: error: declaration of 'class std::future'

     class future;


把APP_ABI 的值改为armeabi-v7a后编译通过。。。

你可能感兴趣的:(ndk c++11 编译的坑)