Writing a tf broadcaster (C++) errors
Hello,
after adding those lines to CMakeLists.txt:
add_executable(turtle_tf_broadcaster src/turtle_tf_broadcaster.cpp)
target_link_libraries(turtle_tf_broadcaster ${catkin_LIBRARIES})
Errors like this appeared:
CMakeFiles/turtle_tf_broadcaster.dir/src/turtle_tf_broadcaster.cpp.o: In function `poseCallback(boost::shared_ptr<turtlesim::Pose_<std::allocator<void> > const> const&)':
turtle_tf_broadcaster.cpp:(.text+0x4f): undefined reference to `tf::TransformBroadcaster::TransformBroadcaster()'
turtle_tf_broadcaster.cpp:(.text+0x1b7): undefined reference to `ros::Time::now()'
turtle_tf_broadcaster.cpp:(.text+0x1fc): undefined reference to `tf::TransformBroadcaster::sendTransform(tf::StampedTransform const&)'
CMakeFiles/turtle_tf_broadcaster.dir/src/turtle_tf_broadcaster.cpp.o: In function `main':
turtle_tf_broadcaster.cpp:(.text+0x322): undefined reference to `ros::init(int&, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
turtle_tf_broadcaster.cpp:(.text+0x356): undefined reference to `ros::console::g_initialized'
turtle_tf_broadcaster.cpp:(.text+0x366): undefined reference to `ros::console::initialize()'
turtle_tf_broadcaster.cpp:(.text+0x3bb): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)'
turtle_tf_broadcaster.cpp:(.text+0x3fc): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
turtle_tf_broadcaster.cpp:(.text+0x406): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
turtle_tf_broadcaster.cpp:(.text+0x458): undefined reference to `ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
turtle_tf_broadcaster.cpp:(.text+0x4bf): undefined reference to `ros::NodeHandle::NodeHandle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
turtle_tf_broadcaster.cpp:(.text+0x571): undefined reference to `ros::spin()'
turtle_tf_broadcaster.cpp:(.text+0x585): undefined reference to `ros::Subscriber::~Subscriber()'
turtle_tf_broadcaster.cpp:(.text+0x594): undefined reference to `ros::NodeHandle::~NodeHandle()'
turtle_tf_broadcaster.cpp:(.text+0x636): undefined reference to `ros::NodeHandle::~NodeHandle()'
turtle_tf_broadcaster.cpp:(.text+0x667): undefined reference to `ros::NodeHandle::~NodeHandle()'
turtle_tf_broadcaster.cpp:(.text+0x698): undefined reference to `ros::Subscriber::~Subscriber()'
turtle_tf_broadcaster.cpp:(.text+0x6c0): undefined reference to `ros::Subscriber::~Subscriber()'
turtle_tf_broadcaster.cpp:(.text+0x6d4): undefined reference to `ros::Subscriber::~Subscriber()'
turtle_tf_broadcaster.cpp:(.text+0x6e8): undefined reference to `ros::NodeHandle::~NodeHandle()'
CMakeFiles/turtle_tf_broadcaster.dir/src/turtle_tf_broadcaster.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
turtle_tf_broadcaster.cpp:(.text+0x7b0): undefined reference to `boost::system::generic_category()'
turtle_tf_broadcaster.cpp:(.text+0x7bc): undefined reference to `boost::system::generic_category()'
turtle_tf_broadcaster.cpp:(.text+0x7c8): undefined reference to `boost::system::system_category()'
CMakeFiles/turtle_tf_broadcaster.dir/src/turtle_tf_broadcaster.cpp.o: In function `tf2_ros::TransformBroadcaster::~TransformBroadcaster()':
turtle_tf_broadcaster.cpp:(.text._ZN7tf2_ros20TransformBroadcasterD2Ev[_ZN7tf2_ros20TransformBroadcasterD5Ev]+0x1b): undefined reference to `ros::Publisher::~Publisher()'
turtle_tf_broadcaster.cpp:(.text._ZN7tf2_ros20TransformBroadcasterD2Ev[_ZN7tf2_ros20TransformBroadcasterD5Ev]+0x27): undefined reference to `ros::NodeHandle::~NodeHandle()'
turtle_tf_broadcaster.cpp:(.text._ZN7tf2_ros20TransformBroadcasterD2Ev[_ZN7tf2_ros20TransformBroadcasterD5Ev]+0x38): undefined reference to `ros::NodeHandle::~NodeHandle()'
CMakeFiles/turtle_tf_broadcaster.dir/src/turtle_tf_broadcaster.cpp.o: In function `ros::Subscriber ros::NodeHandle::subscribe<turtlesim::Pose_<std::allocator<void> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned ...