Ask Your Question
1

parse error

asked 2015-02-06 06:36:46 -0500

zuygar gravatar image

I am using ros hydro and studying ros tutorials in wiki.ros.org . At 11th tutorial i tried to write a publisher and subscriber. At last step "catkin_make" command had an error as below:

CMake Error: Error in cmake code at /home/meam/catkin_ws/src/beginner_tutorials/CMakeLists.txt:168: Parse error. Expected "(", got newline with text " ". -- Configuring incomplete, errors occurred! make: * [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed

So what is the problem ?

edit retag flag offensive close merge delete

Comments

1

I guess @jarvisschultz answer fixes this. In the future, if an error message lists a specific file and line, please add the contents of this file to the question (Copy and Paste + a resulting long question text is fine).

dornhege gravatar imagedornhege ( 2015-02-06 08:53:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-02-06 08:05:21 -0500

There is something wrong with the CMakeLists.txt file that is located at /home/meam/catkin_ws/src/beginner_tutorials/CMakeLists.txt. The error message is telling you that on line 168 you are using a CMake function incorrectly. You would get this error if, for example, the line

add_dependencies(listener beginner_tutorials_generate_messages_cpp)

was written as

add_dependencies
(listener beginner_tutorials_generate_messages_cpp)

It also seems like your CMakeLists.txt is way too long. The one the tutorial suggests using is only 30 lines long. Why is yours 168 (at least)?

To fix this problem, you need to edit that file to look exactly like the one the tutorial shows. The following commands would do this for you:

cd /home/meam/catkin_ws/src/beginner_tutorials/
wget -N https://raw.githubusercontent.com/ros/catkin_tutorials/master/create_package_pubsub/catkin_ws/src/beginner_tutorials/CMakeLists.txt
edit flag offensive delete link more

Comments

Hello..! Thank you.. i tried what you said but I still have the same problem. Do you know about another solution?

Andrea019 gravatar imageAndrea019 ( 2016-07-17 15:19:45 -0500 )edit

Depends on what your errors read. If your CMakeLists.txt looks exactly like the one at the link I posted, and you're still getting an error, then I'd recommend opening a new question that contains a copy of your CMakeLists.txt and the output errors that you are getting.

jarvisschultz gravatar imagejarvisschultz ( 2016-07-18 09:12:29 -0500 )edit

I solved by deleting the catkin_ws and creating a new one.. It might be radical but it worked.. Thank you anyway jarvis :)

Andrea019 gravatar imageAndrea019 ( 2016-07-18 09:34:21 -0500 )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

Stats

Asked: 2015-02-06 06:36:46 -0500

Seen: 862 times

Last updated: Feb 06 '15