Comment corriger l'erreur ROS : cpp_commonConfig.cmake manquant

Problème

Lors de la tentative de compilation d’un paquet ROS en utilisant colcon build, vous voyez un message d’erreur tel que

cmake_error_output.txt
CMake Error at /home/uli/dev/Versatile/catkin/install/catkin/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "cpp_common" with
  any of the following names:

    cpp_commonConfig.cmake
    cpp_common-config.cmake

  Add the installation prefix of "cpp_common" to CMAKE_PREFIX_PATH or set
  "cpp_common_DIR" to a directory containing one of the above files.  If
  "cpp_common" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)

Solution

Catkin n’est actuellement pas disponible sous une forme adaptée pour l’installer depuis les sources officielles ROS2.

Par conséquent, clonez le dépôt, compilez-le en utilisant colcon puis exécutez source install/setup.bash avant de compiler votre paquet.

build_and_source_cpp_common.sh
git clone https://github.com/ros/roscpp_core.git
cd roscpp_core/cpp_common
colcon build
source install/setup.bash

Après cela (dans le même shell), compilez à nouveau votre autre paquet en utilisant colcon build.


Check out similar posts by category: ROS