问题 Android NDK:错误:必须使用-std = c ++ 11或-std = gnu ++ 11编译器选项启用


我想在我的android应用程序中使用一个大的c ++库。我正在使用eclipse与android ndk插件。当我运行它时,我收到此错误消息;

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中启用此选项?


12920
2017-12-23 20:58


起源



答案:


将“-std = c ++ 11”添加到您的 CFLAGS 在你的 Android.mk

LOCAL_CFLAGS += -std=c++11

13
2017-12-23 21:12



我添加了,我得到了相同的错误消息。你能用完整的语法输入吗? - SavasCinar
谢谢你的编辑。有效。 - SavasCinar
或LOCAL_CFLAGS + = -std = gnu ++ 11让它适合我 - AdMor


答案:


将“-std = c ++ 11”添加到您的 CFLAGS 在你的 Android.mk

LOCAL_CFLAGS += -std=c++11

13
2017-12-23 21:12



我添加了,我得到了相同的错误消息。你能用完整的语法输入吗? - SavasCinar
谢谢你的编辑。有效。 - SavasCinar
或LOCAL_CFLAGS + = -std = gnu ++ 11让它适合我 - AdMor