[Solved]Catkin_make msg and srv error
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 ...
Share the entire CMakeLists.txt
Thank you for your comment. I uploaded the entire txt.file