roy*_*eet 16 android stlport c++11 android-studio
我试图在android studio(ndk r10d)中编译一个使用一些C++代码的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,我宁愿使用标准实现.
小智 19
http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared 在代码中使用头文件.
#include <iostream>
#include <memory>
@TC 看来你是对的。在寻找我的问题的解决方案时,我看到了您对另一个问题的声明,但由于我使用的库是用 C++11 和 STLport 编译的,我认为这个声明可能不正确。
我认为发生的情况是我正在使用的库没有使用 STLport 缺少的任何 C++11 功能。它们仅使用 gcc 编译器支持的 C++11 功能。我需要 gnuStl 来支持我正在使用的功能。
我的解决方案是对智能指针和所有其他缺失的 C++11 功能使用 boost 实现。
| 归档时间: | 
 | 
| 查看次数: | 33228 次 | 
| 最近记录: |