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

Error when building TEB local planner: "Target 'tf' of type EXECUTABLE may not be linked into another target"

asked 2018-01-31 09:29:30 -0500

xperroni gravatar image

updated 2018-01-31 14:21:16 -0500

When building the latest version of teb_local_planner in ROS Kinect from source, I get the following error:

CMake Error at teb-local-planner/CMakeLists.txt:197 (target_link_libraries):
  Target "tf" of type EXECUTABLE may not be linked into another target.  One
  may link only to STATIC or SHARED libraries, or to executables with the
  ENABLE_EXPORTS property set.


CMake Error at teb-local-planner/CMakeLists.txt:208 (target_link_libraries):
  Target "tf" of type EXECUTABLE may not be linked into another target.  One
  may link only to STATIC or SHARED libraries, or to executables with the
  ENABLE_EXPORTS property set.

Cheking the CMakeLists.txt file, lines 197 and 208 correspond to target_link_libraries() directives; when checking the value of ${catkin_LIBRARIES} I do see a reference to the tf executable.

Why is catkin adding the tf executable to the libraries variable?

Edit: I'm running ROS Kinetic on Ubuntu Xenial (16.04) and Intel notebook, with cmake 3.5.1 and gcc 5.4.0.

edit retag flag offensive close merge delete

Comments

I still don't understand why catkin is doing that, but I noticed that compiling with catkin_make_isolated instead of catkin_make seems to avoid the issue, whatever its cause.

xperroni gravatar image xperroni  ( 2018-01-31 09:30:37 -0500 )edit

I think it'd help if you could give a little bit more info (as these sort of things tend to be highly platform/os/version of CMake dependent). So: could you add your platform, OS and version of relevant parts of your build chain (ie: gcc)?

gvdhoorn gravatar image gvdhoorn  ( 2018-01-31 09:41:38 -0500 )edit

Just an observation: Kinetic was specced with CMake 3.0.2 (see REP-3). You're running 3.5.1. That is quite a difference.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-31 14:23:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-01-31 16:31:52 -0500

ahendrix gravatar image

catkin_make builds with all packages in a combined cmake workspace, which means that target names are used for dependencies between packages. When using catkin_make_isolated or catkin build, packages are built in separate workspaces, and these dependencies use library names.

Since the tf package probably exports and library target named tf, and since teb_local_planner depends on tf, that target name gets added ${catkin_LIBRARIES}.

I suspect that you have another executable target named tf somewhere in your workspace, and cmake is getting the executable and library targets confused. Try to find another package with something like add_executable(tf ....), comment out that executable and try rebuilding.

edit flag offensive delete link more

Comments

Worked like a charm!!!

Robot gravatar image Robot  ( 2018-12-15 06:46:16 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-01-31 09:29:30 -0500

Seen: 1,814 times

Last updated: Jan 31 '18