Linking error libtf.so
Hi all,
I'm linking the TF library, but somehow I get a linking error in the TF library. I already tried to reinstall the TF package but somehow i can't get it working. This is the error I get:
/opt/ros/melodic/lib/libtf.so: undefined reference to `tf2_ros::TransformListener::TransformListener(tf2::BufferCore&, ros::NodeHandle const&, bool)'
collect2: error: ld returned 1 exit status
Asked by ROS__ROS on 2020-05-02 14:36:40 UTC
Comments
Hello, I have the same problem! Have you managed to solve this issue?
Asked by bboylevi89@gmail.com on 2020-07-19 18:48:53 UTC
Yes, somehow it was linking against the wrong TF library which was inside of my repo. I removed them from my own repository and got it working.
Asked by ROS__ROS on 2020-07-21 06:17:20 UTC
Did u mean the "libtf.so" is the wrong one and the correct one is "libtf2.so"? Thanks!
Asked by bboylevi89@gmail.com on 2020-07-21 06:32:19 UTC
First test the TF library in a new project and see if it works. In case it works, there is nothing wrong with your ROS installation. In my case it worked in another project, so I knew the fault was in my repository. I'm not really sure what you mean, but in my case I had to remove a lot of TF files which were in my local repository and I linked them from my installation instead.
Asked by ROS__ROS on 2020-07-29 06:52:31 UTC
hello, I am having this issue but still do not know how to solve it?
Asked by sal on 2022-04-12 15:23:13 UTC
Can you please elaborate? Where were the additional TF files in your repository? Which files did you delete? Which TF library was in your project to begin with?
I am having a similar issue while trying to transfer a project from melodic to noetic.
Asked by TankyFranky on 2023-02-09 20:02:21 UTC
My Setup and Solution: Moving from Melodic to Noetic, I originally had the geometry2 source package in my workspace. This is the package I assume the above comments are talking about. Geometry2 contains tf2 and many other tf related packages.
The problem is the order of operations. Before ever calling
catkin_make
, be sure to first remove the geometry2 package and be sure you have it installed as a rospkgsudo apt install ros-noetic-geometry2
. The you cancatkin_make
as you would normaly.Probable cause: libtf.so links to the wrong geometry2 package and cant be changed using
catkin_make
even after deleting the source geometry2 package. My solution was to restore my workspace from a backup, then delete the geometry2 source package, then call catkin_make. In that order specifically. I'm guessing you can just copy your files into a new workspace if you don't have a backup.Asked by TankyFranky on 2023-02-09 20:29:32 UTC