描述

ROS下编译cpp文件时,出现编译错误
错误提示

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

解决方案

在需要编译的包的CMakeLists.txt文件下,添加如下一句话

add_compile_options(-std=c++11)

使用C++ 11编译方式,问题解决