ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

"undefined reference to" error occurs when object file (.so file), corresponding to a particular included header has not been linked to your target (the executable to be built). In this case, tf/transform_broadcaster.h.

try adding this line in your CMakelists.txt: target_link_libraries(<name of="" executable=""> <location of="" file="">/_tf.so <location of="" file="">/_tf2.so )

eg. target_link_libraries(state_publisher opt/ros/groovy/lib/python2.7/dist-packages/tf/_tf.so opt/ros/groovy/lib/python2.7/dist-packages/tf2/_tf2.so )

Also, if not added, add tf package dependency in manifest.xml.

"undefined reference to" error occurs when object file (.so file), corresponding to a particular included header has not been linked to your target (the executable to be built). In this case, tf/transform_broadcaster.h.

try adding this line in your CMakelists.txt: target_link_libraries(<name of="" executable=""> CMakelists.txt:

target_link_libraries("name of executable" <location of="" file="">/_tf.so <location of="" file="">/_tf2.so "location of file"/_tf.so "location of file"/_tf2.so )

put the location of the file _tf.so and _tf2.so in the respective "location of file"

eg. target_link_libraries(state_publisher opt/ros/groovy/lib/python2.7/dist-packages/tf/_tf.so opt/ros/groovy/lib/python2.7/dist-packages/tf2/_tf2.so )

Also, if not added, add tf package dependency in manifest.xml.