I am trying to compile a .cpp
file which uses some of the ROS
library functions like "ros/ros.h"
, "std_msgs/String.h"
. In the make file, I have included the path for the respective include files in the include section.
But when I am compiling the .cpp
, I am getting errors like:
:Undefined reference to 'ros::init(int&, char**,
std::__cxx11::basic_string<char, std::char_traits<char="">,
std::allocator<char>> const&, unsigned int)'.
Like wise I am getting some other errors like
:Undefined reference to ros::NodeHandle
:Undefined reference to ros::Rate::Rate(double)
:Undefined reference to ros::ok()
etc.
What could be the reason for such errors? How can I overcome these errors?