Robotics StackExchange | Archived questions

std_msgs::std_msgs__rosidl_generator_c but the target was not found.

Hello,

I am running Ubuntu 18.04 on Jetson Xavier AGX, with ROS1 noetic and ROS2 galactic both from source building.

I build ROS1 and ROS2 using following commands

source /opt/ros/noetic/setup.bash

source /opt/ros/galactic/install/setup.bash 

source /root/ros2_pkgs/install/setup.bash

cd /workspace 

colcon build ... <- error occurs 

The error messages I encounter is as below

CMake Error at /opt/ros/galactic/install/share/rclcpp/cmake/rclcppExport.cmake:61 (set_target_properties):
  The link interface of target "rclcpp::rclcpp" contains:

    rosgraph_msgs::rosgraph_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Error at /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collector_test_msgs__rosidl_generator_cExport.cmake:61 (set_target_properties):
  The link interface of target
  "libstatistics_collector::libstatistics_collector_test_msgs__rosidl_generator_c"
  contains:

    std_msgs::std_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Error at /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collector_test_msgs__rosidl_typesupport_introspection_cExport.cmake:61 (set_target_properties):
  The link interface of target
  "libstatistics_collector::libstatistics_collector_test_msgs__rosidl_typesupport_introspection_c"
  contains:

    std_msgs::std_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Error at /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collector_test_msgs__rosidl_typesupport_cExport.cmake:61 (set_target_properties):
  The link interface of target
  "libstatistics_collector::libstatistics_collector_test_msgs__rosidl_typesupport_c"
  contains:

    std_msgs::std_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Error at /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collector_test_msgs__rosidl_generator_cppExport.cmake:61 (set_target_properties):
  The link interface of target
  "libstatistics_collector::libstatistics_collector_test_msgs__rosidl_generator_cpp"
  contains:

    std_msgs::std_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Error at /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collector_test_msgs__rosidl_typesupport_introspection_cppExport.cmake:61 (set_target_properties):
  The link interface of target
  "libstatistics_collector::libstatistics_collector_test_msgs__rosidl_typesupport_introspection_cpp"
  contains:

    std_msgs::std_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Error at /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collector_test_msgs__rosidl_typesupport_cppExport.cmake:61 (set_target_properties):
  The link interface of target
  "libstatistics_collector::libstatistics_collector_test_msgs__rosidl_typesupport_cpp"
  contains:

    std_msgs::std_msgs__rosidl_generator_c

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /opt/ros/galactic/install/share/libstatistics_collector/cmake/libstatistics_collectorConfig.cmake:41 (include)
  /opt/ros/galactic/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /opt/ros/galactic/install/share/rclcpp/cmake/rclcppConfig.cmake:41 (include)
  CMakeLists.txt:23 (find_package)


CMake Generate step failed.  Build files cannot be regenerated correctly.

Asked by kenloumixx on 2023-05-07 22:02:11 UTC

Comments

Answers