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

catkin make error

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

wjch gravatar image

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

gvdhoorn gravatar image

I input catkin_make,then output:

CMake Error: Error in cmake code at
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:


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

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

Steven_Daniluk gravatar image

The lines,


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

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


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 -0600 )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 -0600 )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 -0600 )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 -0600 )edit

Please check the answer as accepted.

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

Question Tools

1 follower


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

Seen: 2,759 times

Last updated: Mar 12 '16