Could not find a package configuration file provided by "roscpp"

asked 2023-03-27 09:34:51 -0500

crzonga gravatar image

I have ROS noetic installed on Ubuntu 20.04 LTS, when I try to build my workspace with my own ROS project I get the following cmake error:

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "roscpp" with any
   of the following names:

    roscppConfig.cmake
    roscpp-config.cmake

Add the installation prefix of "roscpp" to CMAKE_PREFIX_PATH or set
"roscpp_DIR" to a directory containing one of the above files.  If "roscpp"
provides a separate development package or SDK, be sure it has been
installed.

Call Stack (most recent call first):
  CMakeLists.txt:19 (find_package)

This is the CMakeLists.txt:

cmake_minimum_required(VERSION "3.16")
find_package(catkin REQUIRED COMPONENTS
    roscpp
    std_msgs
    sensor_msgs
)

catkin_package(
# LIBRARIES oakd_orbslam3
CATKIN_DEPENDS roscpp std_msgs sensor_msgs
)
...

I have made sure that /opt/ros/noetic/setup.sh has been sourced every time I try to build the workspace, and I do have roscpp package in my /opt/ros/noetic/share directory and it can also be seen as an apt package.

edit retag flag offensive close merge delete