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

talker.cpp CMakeList

asked 2021-10-23 01:30:14 -0500

santK gravatar image

updated 2021-10-26 08:54:19 -0500

lucasw gravatar image

Hello, I am just starting out with Ubuntu and ROS. I followed the example of creating talker from ROSWiki Tutorial:

But I get the following error

The dependency target "beginner_tutorials_generate_messages_cpp" of target
  "talker" does not exist.

Can someone help me out?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2021-10-23 06:15:13 -0500

sampreets3 gravatar image


It is a little difficult to diagnose the issue without having a look at the CMakeLists.txt file, but you can try and check if you have also named your package "beginner_tutorials", as shown in the tutorial. If not, try replacing the

"beginner_tutorials_generate_messages_cpp" with "(your-project-name)_generate_messages_cpp".

Hopefully this will solve your problem.

Also, I would request you to upload your CMakeLists.txt file for better understanding.

edit flag offensive delete link more

answered 2021-10-23 08:44:50 -0500

Mike Scheutzow gravatar image

This page assumes you have already performed the steps in the prior pages. See the "Note" just under the title of the page you linked.

Have you done the steps listed in the prior pages?

edit flag offensive delete link more


The "Note" just has some commands to check params. Am I missing something?

santK gravatar image santK  ( 2021-10-23 10:01:31 -0500 )edit

That note points to a backward chain of pages. Your error message indicates you either 1) did not execute one of the steps to prepare your environment, or 2) that you have a typo in your CMakeLists.txt.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-10-23 10:28:31 -0500 )edit

Actually, I found a way. Of the 3 lines needed in CMakeLists for talker, I commented out the dependencies line and it works fine. I still don't know if the node works without that line then what is the purpose of the add_dependencies Thank you!

santK gravatar image santK  ( 2021-10-23 11:14:10 -0500 )edit

generate_messages is needed when you have defined a custom message to send between ros nodes.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-10-24 07:18:57 -0500 )edit

Question Tools



Asked: 2021-10-23 01:30:14 -0500

Seen: 344 times

Last updated: Oct 26 '21