/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")

注意:每一个功能包都要加,元功能包除外。

posted on 2020-10-08 20:05  不当小朋友  阅读(200)  评论(0编辑  收藏  举报

导航