beginner tutorial catkin_make error directory not found
I try to catkin_make packages but it fais:
CMake Error at /opt/ros/groovy/share/genmsg/cmake/genmsg-extras.cmake:64 (message) : add_message_files() directory not found: /home/user/catkin_ws/src/msg
I can't understand why it tries to find msg files in src/msg.
catkin_ws/src/beginner_tutorials/CMakeList.txt
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)
find_package(catkin REQUIRED PACKAGES roscpp rospy std_msgs message_generation)
add_message_files(FILES Num.msg)
add_service_files(FILES AddTwoInts.srv)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
DEPENDS system_lib)
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_message_cpp)
add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_generate_message_cpp)
catkin_ws/src/CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)
find_package(catkin REQUIRED PACKAGES roscpp rospy std_msgs message_generation)
add_message_files(FILES Num.msg)
add_service_files(FILES AddTwoInts.srv)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
DEPENDS system_lib)
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_message_cpp)
add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_generate_message_cpp)
Can you please be more clear and explain more about what you are doing. Can you tell me if you sourced the file and can you output you ROS path.
ROS_ROOT=/opt/ros/groovy/share/ros, I'm studying tutorial "Writing a Simple Publisher and Subscriber (C++)" and try to make packages. Previously I created msg and srv files in corresponding paths in beginner_tutorial.
Could you show your CMake file ?
Done, Lucile
Did you generate your catkin workspace with catkin_init_workspace ? If so, your catkin_ws/src/CMakeLists.txt should be totally different. Anyway, you ask for Num.msg and AddTwoInts.srv in src folder and I think that's why cmake looks for them in src/msg folder.
Yes, but I accidentally delete CMakeLists.txt in catkin_ws/src and tried to generate it using catkin_init_workspace once again, and it created that file. I can't find an example of necessary file to copy in catkin_ws/src.
just do another catkin_workspace then to run the publisher example.