编译ros程序时出现的问题。文件中包含 #include “ros/package.h”,但是编译的时候总是提示undefined reference to "ros::package::getPath(...)". CMakeList.txt中加入 find_package(catkin REQUIRED COMPONENTS roslib) 后正常。
roslib for C++ Developers
roslib contains the definition of the ros::Time and ros::Duration objects used in roscpp and other ROS C++ libraries. It also contains functions for querying the ROS package system.
Code API
- Time-related: ros::Time, ros::Duration, ros::Rate, ros::WallTime, ros::WallDuration, ros::WallRate. Also see the roscpp Time overview.
- Package-related: ros::package namespace
- Debug-related: ros::debug namespace