首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >unique_ptr编译错误

unique_ptr编译错误
EN

Stack Overflow用户
提问于 2012-03-19 15:43:33
回答 1查看 28.8K关注 0票数 20

如果我告诉你我不能编译这段代码,我想这是很尴尬的。你能帮我一下吗:

代码语言:javascript
复制
#include<memory>
using namespace std;

int  main()
{
    std::unique_ptr<int> p1(new int(5));
    return 0;
}
代码语言:javascript
复制
$ gcc main.cpp 
main.cpp: In function ‘int main()’:
main.cpp:6:2: error: ‘unique_ptr’ was not declared in this scope
main.cpp:6:13: error: expected primary-expression before ‘int’
main.cpp:6:13: error: expected ‘;’ before ‘int’

$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9766568

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档