我正在尝试在Android Studio(ndk r10d)中编译一个使用一些C++代码的Android应用程序。我需要C++11,因此我添加了 -std=gnu++11
(我需要 gnu++11
而不是 c++11
,因为我正在使用某个扩展)。由于我正在使用其他使用此stl库的库,因此我正在使用stlport 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,我更愿意使用标准实现。