Ask Your Question
0

Compilation error: "no such file or directory: std_msg/String.h"

asked 2018-05-30 00:02:03 -0600

CHIN gravatar image

updated 2018-06-13 02:56:24 -0600

jayess gravatar image

I'm totally new to ROS. Im learning from ROS WIKI

#### Running command: "cmake /home/mob17/catkin_ws/src
-DCATKIN_DEVEL_PREFIX=/home/mob17/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/mob17/catkin_ws/install -G Unix Makefiles" in "/home/mob17/catkin_ws/build"

-- Using CATKIN_DEVEL_PREFIX: /home/mob17/catkin_ws/devel --
Using CMAKE_PREFIX_PATH: 
/home/mob17/catkin_ws/devel;/home/mob17/kentac_ws/devel;/opt/ros/indigo -- This workspace overlays: /home/mob17/catkin_ws/devel;/home/mob17/kentac_ws/devel;/opt/ros/indigo -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Using Debian 
Python package layout -- Using 
empy: /usr/bin/empy -- Using 
CATKIN_ENABLE_TESTING: ON -- Call 
enable_testing() -- Using 
CATKIN_TEST_RESULTS_DIR: 
/home/mob17/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be 
built -- Using Python nosetests: 
/usr/bin/nosetests-2.7 -- catkin 0.6.19 -- 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;genlisp;genpy -- Configuring done -- Generating 
done -- Build files have been 
written to: 
/home/mob17/catkin_ws/build #### #### Running command: "make -j4 -l4" in "/home/mob17/catkin_ws/build" #### [ 50%] Built target listener [100%] Building CXX object 
beginner_tutorials/CMakeFiles/talker.dir/src/talker.cpp.o /home/mob17/catkin_ws/src/beginner_tutorials/src/talker.cpp:2:28: fatal error: std_msg/String.h: 
そのようなファイルやディレクトリはありません #include 
"std_msg/String.h" ^ compilation terminated. make[2]: * 
[beginner_tutorials/CMakeFiles/talker.dir/src/talker.cpp.o] エラー 1 make[1]: 
[beginner_tutorials/CMakeFiles/talker.dir/all] エラー 2 make: ** [all] エラー 2 Invoking 
"make -j4 -l4" failed

And here is my cmake list


cmake_minimum_required(VERSION
2.8.3) project(beginner_tutorials)

## Find catkin and any catkin packages find_package(catkin
REQUIRED COMPONENTS roscpp rospy
std_msgs genmsg)

## Declare ROS messages and services
#add_message_files(FILES Num.msg)
#add_service_files(FILES AddTwoInts.srv)

## Generate added messages and services
#generate_messages(DEPENDENCIES std_msgs)

## Declare a catkin package catkin_package()

## Build talker and listener include_directories(include
${catkin_INCLUDE_DIRS})

add_executable(talker
src/talker.cpp)
target_link_libraries(talker
${catkin_LIBRARIES})
add_dependencies(talker
beginner_tutorials_generate_messages_cpp)

add_executable(listener
src/listener.cpp)
target_link_libraries(listener
${catkin_LIBRARIES})
add_dependencies(listener
beginner_tutorials_generate_messages_cpp)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2018-05-30 01:06:10 -0600

ahendrix gravatar image

updated 2018-05-30 03:22:36 -0600

gvdhoorn gravatar image

It looks like you have a typo. You probably have #include "std_msg/String.h" but you should have #include "std_msgs/String.h". Note the s at the end of std_msgs.

edit flag offensive delete link more

Comments

Thank you very much!!

CHIN gravatar imageCHIN ( 2018-05-31 03:08:29 -0600 )edit

@CHIN if this answered your question then please click on the check mark to mark the question as correct

jayess gravatar imagejayess ( 2018-06-13 02:57:13 -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

Stats

Asked: 2018-05-30 00:02:03 -0600

Seen: 535 times

Last updated: Jun 13 '18