0
$\begingroup$

Rosanswers logo

When I try to compile ROS files in ways such as using the command "g++ openni_tracker.cpp", I get messages saying "no such file or directory" for the lines with included files. However, the file runs if I use the ROS commands, such as rosrun and roslaunch. Are these commands necessary, or is there another way to compile and run the files?


Originally posted by qdocehf on ROS Answers with karma: 208 on 2011-07-05

Post score: -2


Original comments

Comment by dornhege on 2011-07-06:
ROS uses cmake for making. I would suggest going through the ROS beginner tutorials. Thing like this are explained there.

Comment by qdocehf on 2011-07-06:
Sorry. I did mean to use run in the title of the question, but I meant something along the lines of how can I change the code so it can compile, and eventually run.

Comment by Asomerville on 2011-07-05:
You should probably clarify your question. When you say "[r]un ROS files" and make reference to "g++ openni_tracker.cpp". I get the impression that you misunderstand the distinction between running and compiling. If this is the case you might need to start with more basic programming tutorials.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

compiled 'ros' files generate normal binaries in the case of cpp for example. You will be able to see these binaries in the bin folder . You can execute them just like normal binaries with ./binary_file but you have to be in the bin folder. The ros utilities like rosrun and roslaunch relieve you of the burden of moving between folder just to execute binaries.

Also I dont know what you mean by "g++ openni_tracker.cpp", but if you mean compiling a cpp file, you can use the Make file generated in the package, or more conveniently use rosmake.


Originally posted by makokal with karma: 1295 on 2011-07-05

This answer was ACCEPTED on the original site

Post score: 6

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.