Error while compiling transform_listener from ROS tutorials
Hey I am trying to follow the ROS tutorials on Navigation Stack
I can successfully compile tf_broadcaster.cpp but it throws a bunch of errors with tf_listener.cpp. Could you please have a look and tell me what should I do?
I have even tried copy/pasting the code from the website, still doesn't work.
Running ros groovy with ubuntu 12.04
[ 80%] Building CXX object robot_setup_tf/CMakeFiles/tf_listener.dir/src/tf_listener.cpp.o
[100%] Building CXX object robot_setup_tf/CMakeFiles/tf_broadcaster.dir/src/tf_broadcaster.cpp.o
Linking CXX executable /home/krunal/turtlebot/Research/Gatech/devel/lib/robot_setup_tf/tf_broadcaster
[100%] Built target tf_broadcaster
Linking CXX executable /home/krunal/turtlebot/Research/Gatech/devel/lib/robot_setup_tf/tf_listener
CMakeFiles/tf_listener.dir/src/tf_listener.cpp.o: In function `transformPoint(tf::TransformListener const&)':
tf_listener.cpp:(.text+0xda): undefined reference to `tf::TransformListener::transformPoint(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, geometry_msgs::PointStamped_<std::allocator<void> > const&, geometry_msgs::PointStamped_<std::allocator<void> >&) const'
tf_listener.cpp:(.text+0xf9): undefined reference to `ros::console::g_initialized'
tf_listener.cpp:(.text+0x109): undefined reference to `ros::console::initialize()'
tf_listener.cpp:(.text+0x152): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x18d): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x197): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
tf_listener.cpp:(.text+0x231): undefined reference to `ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
tf_listener.cpp:(.text+0x318): undefined reference to `ros::console::g_initialized'
tf_listener.cpp:(.text+0x328): undefined reference to `ros::console::initialize()'
tf_listener.cpp:(.text+0x371): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x3ac): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
tf_listener.cpp:(.text+0x3b6): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
tf_listener.cpp:(.text+0x41a): undefined reference to `ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
CMakeFiles/tf_listener.dir/src/tf_listener.cpp.o: In function `main':
tf_listener.cpp:(.text+0x4b5): undefined reference to `ros::init(int&, char**, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
tf_listener.cpp:(.text+0x511): undefined reference to `ros::NodeHandle::NodeHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
tf_listener.cpp:(.text+0x564): undefined reference to `tf::TransformListener::TransformListener(ros::Duration, bool)'
tf_listener.cpp:(.text+0x628): undefined reference to `ros::NodeHandle::createTimer(ros::Duration, boost ...
Tutorial from here http://wiki.ros.org/navigation/Tutorials/RobotSetup/TF Apparently, I cannot add links because I do not have enough karma.
It's probably not linking tf. What is your CMakeLists.txt and what build system do you use?
Added CMakeLists.txt. I am using catkin.
It builds successfully, and while "Linking CXX executable" it gives these errors. Added the two lines before the error message which says precisely that.
Did you found a solution? I ran into the same Problem at the moment.
Sorry I did not. Post the answer here if you do manage to find it!