ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

[Solved]Catkin_make msg and srv error

asked 2020-06-21 07:04:53 -0500

hiro1117 gravatar image

updated 2020-06-22 02:31:05 -0500

Hello, everyone. I am following the tutorial here to set up msg and srv: link text

After I added all things to my tutorials file, I got this output

    CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:224 (message):
  catkin_package() DEPENDS on the catkin package 'message_runtime' which must
  therefore be listed as a run dependency in the package.xml
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  beginner_tutorials/CMakeLists.txt:104 (catkin_package)


-- Configuring incomplete, errors occurred!
See also "/home/ros/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ros/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:712: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

And I went to the CMakeLists.txt:104 to check what is wrong. Here's the code.

 catkin_package(
  INCLUDE_DIRS include
  LIBRARIES beginner_tutorials
  CATKIN_DEPENDS message_runtime roscpp rospy std_msgs
   DEPENDS system_lib
 )

There was a note for this code in the page of the tutorial, but I couldn't understand what I really should do for it.

In the tutorial, they said "Also make sure you export the message runtime dependency. "

catkin_package(
  ...
  CATKIN_DEPENDS message_runtime ...
  ...)

It was commented lines, so I uncommented them and then I got the error. So I also tried commenting out them, and I got an error too.

Thank you for any help!!

Here is the entire CMakeLists.txt

cmake_minimum_required(VERSION 3.0.2)
project(beginner_tutorials)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  message_generation
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
 add_message_files(
   FILES
   Num.msg
 )

## Generate services in the 'srv' folder
 add_service_files(
   FILES
   AddTwoInts.srv
 )

## Generate actions in the 'action' folder
# add_action_files(
#   FILES ...
(more)
edit retag flag offensive close merge delete

Comments

Share the entire CMakeLists.txt

parzival gravatar image parzival  ( 2020-06-21 09:40:42 -0500 )edit

Thank you for your comment. I uploaded the entire txt.file

hiro1117 gravatar image hiro1117  ( 2020-06-21 09:56:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-21 23:15:14 -0500

hiro1117 gravatar image

I figured out that I haven't uncomment them in the package.xml:

  <build_depend>message_generation</build_depend>
  <exec_depend>message_runtime</exec_depend>
edit flag offensive delete link more

Comments

Can you mark the question as asnwered (if you feel is already answered)? just below the vote button in this response.

Solrac3589 gravatar image Solrac3589  ( 2020-06-22 01:58:50 -0500 )edit

Hello, Solrac3589. Thank you for your comment. I would love to, but I need 10 points to mark my answer and I do not have so far.. I'm sorry..

hiro1117 gravatar image hiro1117  ( 2020-06-22 02:26:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-21 07:04:53 -0500

Seen: 887 times

Last updated: Jun 22 '20