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

catkin_make does not work since I modified CMakeLists.txt file

asked 2020-09-05 04:18:01 -0500

kucar gravatar image

I have started using ROS a few days ago and I am following the official tutorials(http://wiki.ros.org/ROS/Tut.... Now I need create a msg an srv. I followed the steps in the "2.1 Creating a msg" part and modified my CMakeList.txt file. It now looks like this (I am putting just the uncommented parts since the editor detecs the lines which start with "#" as a bold text:

    find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  message_generation
)

 catkin_package(
        CATKIN_DEPENDS message_runtime
    )

 add_message_files(
   FILES
   Num.msg
 )

 generate_messages(
   DEPENDENCIES
   std_msgs
 )

After these configurations, on a new terminal I tried to run catkin_make on my workspace folder and I received an error such as:

C:\Windows\System32>cd C:\opt\ros\noetic\x64\ros_workspace
C:\opt\ros\noetic\x64\ros_workspace>catkin_make

Base path: C:\opt\ros\noetic\x64\ros_workspace
Source space: C:\opt\ros\noetic\x64\ros_workspace\src
Build space: C:\opt\ros\noetic\x64\ros_workspace\build
Devel space: C:\opt\ros\noetic\x64\ros_workspace\devel
Install space: C:\opt\ros\noetic\x64\ros_workspace\install
####
#### Running command: "nmake cmake_check_build_system" in "C:\opt\ros\noetic\x64\ros_workspace\build"
####

Microsoft (R) Program Maintenance Utility S�r�m� 14.27.29111.0
Telif Hakk� (C) Microsoft Corporation.  T�m haklar� sakl�d�r.

-- Using CATKIN_DEVEL_PREFIX: C:/opt/ros/noetic/x64/ros_workspace/devel
-- Using CMAKE_PREFIX_PATH: C:/opt/rosdeps/x64;C:/opt/ros/noetic/x64;c:\opt\ros\noetic\x64
-- This workspace overlays: C:/opt/ros/noetic/x64;c:/opt/ros/noetic/x64
-- Using PYTHON_EXECUTABLE: C:/opt/python37amd64/python.exe
-- Using default Python package layout
-- Using empy: C:/opt/python37amd64/lib/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: C:/opt/ros/noetic/x64/ros_workspace/build/test_results
-- Found gtest: gtests will be built
-- Using Python nosetests: C:/opt/python37amd64/Scripts/nosetests.exe
-- catkin 0.8.8
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at C:/opt/ros/noetic/x64/share/genmsg/cmake/genmsg-extras.cmake:197 (message):
  generate_messages() must be called before catkin_package() in project
  'beginner_tutorials'
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:73 (generate_messages)


-- Configuring incomplete, errors occurred!
See also "C:/opt/ros/noetic/x64/ros_workspace/build/CMakeFiles/CMakeOutput.log".
See also "C:/opt/ros/noetic/x64/ros_workspace/build/CMakeFiles/CMakeError.log".
NMAKE : fatal error U1077: 'C:\opt\python37amd64\Lib\site-packages\cmake\data\bin\cmake.exe' : D�n�� kodu '0x1'
Stop.
Invoking "nmake cmake_check_build_system" failed

Can you help me with that?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-07 09:41:55 -0500

JackB gravatar image

updated 2020-09-07 09:46:26 -0500

What is is saying is that you cannot declare the package a catkin package, which is done with the catkin_package() instruction, before you call generate_messages(). In order to solve this error move your catkin_package() snippet to the very end of the file.

Read the error:

generate_messages() must be called before catkin_package() in project  beginner_tutorials

And this becomes clear. In order to prevent this error in the future it is highly recommended to follow the instruction to create a catkin package and NOT reorder the components produced in the CMake file. The provided structure and comments/explanations in the auto generated CMakeLists.txt file are your best friend, even if it is overwhelming to start.

This is a duplicate of error when catkin_make install in tutorial about msg/srv

edit flag offensive delete link more

Comments

Did this help your problem @kucar

JackB gravatar image JackB  ( 2020-09-21 08:11:39 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-09-05 04:18:01 -0500

Seen: 759 times

Last updated: Sep 07 '20