Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building robot_localization pkg error with yaml-cpp target not found #1280

Open
iyhabz opened this issue May 15, 2024 · 4 comments
Open

Building robot_localization pkg error with yaml-cpp target not found #1280

iyhabz opened this issue May 15, 2024 · 4 comments

Comments

@iyhabz
Copy link

iyhabz commented May 15, 2024

Hey i am trying to build the robot_localization pkg and keep having the error regarding the yaml-cpp pkg

CMake Error at CMakeLists.txt:82 (add_executable):
  Target "ekf_node" links to target "yaml-cpp::yaml-cpp" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

Full Error message

Starting >>> robot_localization
--- stderr: robot_localization                                                                            
CMake Error at CMakeLists.txt:67 (add_library):
  Target "rl_lib" links to target "yaml-cpp::yaml-cpp" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at CMakeLists.txt:82 (add_executable):
  Target "ekf_node" links to target "yaml-cpp::yaml-cpp" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:87 (add_executable):
  Target "ukf_node" links to target "yaml-cpp::yaml-cpp" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:92 (add_executable):
  Target "navsat_transform_node" links to target "yaml-cpp::yaml-cpp" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:97 (add_executable):
  Target "robot_localization_listener_node" links to target
  "yaml-cpp::yaml-cpp" but the target was not found.  Perhaps a
  find_package() call is missing for an IMPORTED target, or an ALIAS target
  is missing?

CMake Error at CMakeLists.txt:97 (add_executable):
  Target "robot_localization_listener_node" links to target
  "yaml-cpp::yaml-cpp" but the target was not found.  Perhaps a
  find_package() call is missing for an IMPORTED target, or an ALIAS target
  is missing?


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "filter_base-test" links to target "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:178 (ament_add_gtest)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_filter_base_diagnostics_timestamps" links to target
  "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:182 (ament_add_gtest_executable)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ekf" links to target "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:198 (ament_add_gtest)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ekf_node_interfaces" links to target "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:204 (ament_add_gtest_executable)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ukf" links to target "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:230 (ament_add_gtest)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ukf_node_interfaces" links to target "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:236 (ament_add_gtest_executable)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_robot_localization_estimator" links to target
  "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:281 (ament_add_gtest_executable)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_navsat_conversions" links to target "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:294 (ament_add_gtest)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ros_robot_localization_listener" links to target
  "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:297 (ament_add_gtest_executable)


CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ros_robot_localization_listener_publisher" links to target
  "yaml-cpp::yaml-cpp" 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)
  CMakeLists.txt:302 (ament_add_gtest_executable)


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

has any one faced an issue like this?

thanks in advance

@AntoineLevanen
Copy link

Hello,
You need to tell your CMake file where is the yaml-cpp library in order to successfully build the ROS robot_localization package.
The README of this repository give an explanation on how to include the yaml-cpp library to your C++ project here.
You can add this before the find_package() of your CMake file (don't forget to speciffy the GIT_TAG argument).

@b-adkins
Copy link

b-adkins commented Aug 7, 2024

The dynmsg package in dynamic_message_introspection has an example of how to include yaml-cpp in a ROS2 package. You might want to check that out.

@annanya-tamu
Copy link

Are you sure you are using the correct branch of robot_localization? Switching to humble-devel instead of ros2 worked for me in resolving this issue.

@lix19937
Copy link

sudo apt-get install libyaml-cpp-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants