Ask Your Question

CMake error when building rclcpp

asked 2021-02-14 05:25:28 -0600

updated 2021-02-14 05:36:44 -0600

I got some errors when building rclcpp using colcon build. The error message is shown below. Any idea where the problem is? I had sourced ${ROS_WS}/install/setup.bash before running colcon build.

 root@48fcb45ebd09:/opt/ros_ws# cat log/latest_build/rclcpp/stderr.log
CMake Error at test/CMakeLists.txt:3 (find_package):
  By not providing "Findtest_msgs.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "test_msgs", but CMake did not find one.

  Could not find a package configuration file provided by "test_msgs" with
  any of the following names:


  Add the installation prefix of "test_msgs" to CMAKE_PREFIX_PATH or set
  "test_msgs_DIR" to a directory containing one of the above files.  If
  "test_msgs" provides a separate development package or SDK, be sure it has
  been installed.
edit retag flag offensive close merge delete


Could you please close either #q371789 or this one?

gvdhoorn gravatar image gvdhoorn  ( 2021-02-14 05:36:35 -0600 )edit

Sorry for the mishap. I edited the question but got a duplicate one.

Zhoulai Fu gravatar image Zhoulai Fu  ( 2021-02-14 05:45:36 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-02-14 05:57:19 -0600

updated 2021-02-14 05:57:33 -0600

It seems things start to work if I do rosdep install -y --from-paths src. I am still a bit surprised that colcon build itself does not take care of dependencies.

edit flag offensive delete link more



Colcon builds packages.

It does not detect, resolve nor download dependencies.

The error you show is a CMake error, as it's CMake which checks whether required dependencies are present (as long as the developer/maintainer has written a proper CMakeLists.txt that is).

Personally I quite like the separation of concerns. Build tools which try to do everything can be rather annoying.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-14 07:15:13 -0600 )edit

Separation of concerns makes sense to me. Thanks.

Zhoulai Fu gravatar image Zhoulai Fu  ( 2021-02-15 06:16:40 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-02-14 05:25:28 -0600

Seen: 235 times

Last updated: Feb 14