首页 > 其他 > 详细

error: ‘shared_ptr’ in namespace ‘std’ does not name a type

时间:2014-09-28 12:14:03      阅读:724      评论:0      收藏:0      [点我收藏+]

用G++编译项目的时候发生标题上的错误,原因是,这是c++ 11标准的。在给g++传递命令行的时候加上-std=c++0x就行了。

还需要在源码中#include<memory>

我的cmakelists里面要这样改:

   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -std=c++0x")

 

 

references:

http://www.cmake.org/Wiki/CMake/Tutorials/C%2B%2B11Flags

http://stackoverflow.com/questions/12329226/a-short-c-file-and-makefile-i-can-make-in-the-shell-but-get-lots-of-error-wh

https://github.com/RobotLocomotion/drake/issues/92

error: ‘shared_ptr’ in namespace ‘std’ does not name a type

原文:http://www.cnblogs.com/foohack/p/3997771.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!