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

About executable files

asked 2013-01-07 07:47:06 -0500

Abinaya gravatar image

updated 2013-01-07 09:29:48 -0500

joq gravatar image

I'm the new one to ROS.. I have written two cpp file named talker.cpp and listener.cpp in src and i add two lines seeing below in CMakeLists.txt file

rosbuild_add_executable(talker src/talker.cpp)
rosbuild_add_executable(listener src/listener.cpp)

now when i give a command $make it displays

make: *** No targets specified and no makefile found.  Stop.

Would you please explain me clearly the steps which we need to execute cpp files in ROS environment please explain it me in steps

edit retag flag offensive close merge delete

Comments

please explain in me in steps clearly i'm very new to ROS

Abinaya gravatar image Abinaya  ( 2013-01-07 07:47:55 -0500 )edit
1

Please read the support guidelines before posting. Always tag your posts and provide enough information for us to reproduce the issue. Which exact steps did you follow? Which ROS and Ubuntu versions are you using?

Lorenz gravatar image Lorenz  ( 2013-01-07 08:40:11 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-01-07 08:52:21 -0500

KruseT gravatar image

updated 2013-01-08 03:30:38 -0500

To run make you need a file called makefile. This tutorial tells you steps of how to create a package, including all necessary files: http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage

Else you can use this as a Makefile:

include $(shell rospack find mk)/cmake.mk

This are instructions for ROS fuerte.

EDIT: I am serious: Do the tutorial linked above. Your source files need to go into the src folder, you need a Makefile, and only when you have that Makefile will you get executables in the bin folder. The tutorial explains all that.

edit flag offensive delete link more
-3

answered 2013-01-07 08:28:03 -0500

metal gravatar image

Hi there, In the folder where you have the CMakeLists.txt file. Enter in the terminal: "$cmake ." and after enter: "$ rosmake(this would create the executables).

edit flag offensive delete link more

Comments

3

Never execute cmake . in ROS. This will overwrite the default Makefile generated by roscreate-pkg.

Lorenz gravatar image Lorenz  ( 2013-01-07 08:38:50 -0500 )edit

Question Tools

Stats

Asked: 2013-01-07 07:47:06 -0500

Seen: 1,371 times

Last updated: Jan 08 '13