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

catkin make error

asked 2016-03-12 07:58:58 -0500

wjch gravatar image

updated 2016-03-12 10:09:00 -0500

gvdhoorn gravatar image

I input catkin_make,then output:

CMake Error: Error in cmake code at
/home/jeff/dev/myros1/src/example1/CMakeLists.txt:29:
Parse error.  Expected a command name, got unquoted argument with text "<build_depend>roscpp</build_depend>".
-- Configuring incomplete, errors occurred!
See also "/home/jeff/dev/myros1/build/CMakeFiles/CMakeOutput.log".
See also "/home/jeff/dev/myros1/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

but the txt in my CMakeLists.txt:29 file is:

<build_depend>roscpp</build_depend>
<run_depend>roscpp</run_depend>

I don't why.please help me! I will appreciate it!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-03-12 09:12:32 -0500

Steven_Daniluk gravatar image

The lines,

<build_depend>roscpp</build_depend>
<run_depend>roscpp</run_depend>

belong in the package.xml file. The way you include roscpp in your CMakeLists.txt file is with the following:

find_package(catkin REQUIRED COMPONENTS
  roscpp
)

Look at the ROS wiki pages on CMakeLists.txt and package.xml for more guidelines.

If you still need more help it would be useful to post your CMakeLists.txt and package.xml files so that we can see what is wrong with them.

edit flag offensive delete link more

Comments

Thanks for your attention, so,as you said ,I have added "find_package(catkin REQUIRED COMPONENTS roscpp)" into the txt,but it's the same error,help me please!

wjch gravatar image wjch  ( 2016-03-12 19:47:57 -0500 )edit

this is my txt: cmake_minimum_required(VERSION 2.8.3) project(exam1)

Find catkin macros and libraries

##if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS roscpp)

is used, also find other catkin packages

##find_package(catkin REQUIRED)

System dependencies are found with CMak

wjch gravatar image wjch  ( 2016-03-12 19:55:32 -0500 )edit

Did you also remove the lines <build_depend>roscpp</build_depend> and <run_depend>roscpp</run_depend> from CMakeLists.txt, and put them in package.xml?

Steven_Daniluk gravatar image Steven_Daniluk  ( 2016-03-13 09:35:48 -0500 )edit

yes,I do as what you have said,and now I have solved and it works now!thank you

wjch gravatar image wjch  ( 2016-03-14 05:09:42 -0500 )edit

Please check the answer as accepted.

joq gravatar image joq  ( 2016-03-14 20:17:53 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-03-12 07:58:58 -0500

Seen: 2,945 times

Last updated: Mar 12 '16