我正在尝试在使用一些 C++ 代码的 android studio (ndk r10d) 中编译一个 android 应用程序。我需要 C++11,所以我添加了-std=gnu++11
(我需要gnu++11
而不是c++11
我正在使用的扩展)。我正在使用 stlport stl,因为我使用的其他库使用了这个 stl 库。所以我在 build.gradle 文件中的 cFlags 和 stl 参数看起来像这样:
stl "stlport_static"
cFlags " mylib1.a mylib2.a ... -fexceptions -frtti -std=gnu++11"
我还包括内存:#include <memory>
尝试编译时收到此错误:
'shared_ptr' in namespace 'std' does not name a type
到目前为止,我一直在使用智能指针的 boost 实现,但是随着迁移到 c++11,我宁愿使用标准实现。