Skip to content

Target "managed_transform_buffer" links to target "Boost::date_time" but the target was not found. #24

@cjmodi306

Description

@cjmodi306

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I'm convinced that this is not my fault but a bug.

Description

Upon building the packet, colcon throws the following error:

Starting >>> managed_transform_buffer
--- stderr: managed_transform_buffer                         
CMake Error at /opt/ros/humble/share/ament_cmake_auto/cmake/ament_auto_add_library.cmake:66 (add_library):
  Target "managed_transform_buffer" links to target "Boost::date_time" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:17 (ament_auto_add_library)


CMake Error at /opt/ros/humble/share/ament_cmake_auto/cmake/ament_auto_add_library.cmake:66 (add_library):
  Target "managed_transform_buffer" links to target "Boost::date_time" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:17 (ament_auto_add_library)


CMake Error at /opt/ros/humble/share/ament_cmake_auto/cmake/ament_auto_add_library.cmake:66 (add_library):
  Target "managed_transform_buffer" links to target "Boost::date_time" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:17 (ament_auto_add_library)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "managed_transform_buffer_test" links to target "Boost::date_time"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:37 (_ament_add_gtest_executable)
  /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest.cmake:68 (ament_add_gtest_executable)
  /opt/ros/humble/share/ament_cmake_ros/cmake/ament_add_ros_isolated_gtest.cmake:33 (ament_add_gtest)
  CMakeLists.txt:26 (ament_add_ros_isolated_gtest)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "managed_transform_buffer_test" links to target "Boost::date_time"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:37 (_ament_add_gtest_executable)
  /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest.cmake:68 (ament_add_gtest_executable)
  /opt/ros/humble/share/ament_cmake_ros/cmake/ament_add_ros_isolated_gtest.cmake:33 (ament_add_gtest)
  CMakeLists.txt:26 (ament_add_ros_isolated_gtest)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "managed_transform_buffer_test" links to target "Boost::date_time"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:37 (_ament_add_gtest_executable)
  /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest.cmake:68 (ament_add_gtest_executable)
  /opt/ros/humble/share/ament_cmake_ros/cmake/ament_add_ros_isolated_gtest.cmake:33 (ament_add_gtest)
  CMakeLists.txt:26 (ament_add_ros_isolated_gtest)


CMake Generate step failed.  Build files cannot be regenerated correctly.
---
Failed   <<< managed_transform_buffer [2.49s, exited with code 1]

Upon looking in the CMakeLists.txt and packages.xml, I realized that Boost was not linked to the package. I tried adding the following lines to package.xml and CMakelists.txt and it worked:

(packages.xml):
<build_depend>libboost-date-time-dev</build_depend>
<exec_depend>libboost-date-time-dev</exec_depend>

(CMakeLists.txt):
find_package(Boost REQUIRED COMPONENTS date_time)

Expected behavior

Successful compilation.

Actual behavior

Error, see above.

Steps to reproduce

colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --packages-select managed_transform_buffer

Versions

  • OS: Ubuntu 22.04
  • ROS 2: Humble

Possible causes

Missing linking step in CMakeLists and dependency in packages.xml.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions