ROS Kinetic编译旧版本程序出现 error: ‘shared_ptr’ in namespace ‘std’ does not name a type

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

今天在ROS-Kinetic版本中编译indigo版本编译通过的程序,出现了如下问题

/opt/ros/kinetic/include/moveit/macros/declare_ptr.h:53:16: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
   typedef std::shared_ptr<const Type> Name##ConstPtr;

网上搜了解决办法如下:


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


我的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

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值