Android的NDK:错误:必须用-std启用= C ++ 11或-std = GNU ++ 11的编译器选项编译器、选项、错误、Android

2023-09-06 13:42:36 作者:情到深处放不下

我想在我的Andr​​oid应用程序中使用一个大的C ++库。我使用的Eclipse与Android NDK的插件。当我运行它,我得到这个错误信息;

I am trying to use one big c++ library in my android application. I am using eclipse with android ndk plugin. When I run it, I got this error message;

This file requires compiler and library support for the ISO C++ 2011 standard.This
support is currently experimental, and must be enabled with the -std=c++11 or
-std=gnu++11 compiler  options.

我应该怎么办?我怎样才能使在eclipse这个选项?

What should I do? How can I enable this option in eclipse?

推荐答案

添加-std = C + + 11到你的 CFLAGS Android.mk

Add "-std=c++11" to your CFLAGS in your Android.mk:

LOCAL_CFLAGS += -std=c++11