C ++ executable, sh 1: not found

I have created a C ++ program that works with ros. The first step is to open roscore in the terminal and move from there. I do this withsystem("roscore &");

I have compiled my file and it works fine with. / file.

However, I want to be able to run it as an application (double click). I created a .desktop file and the program appears in my application list. When I run it, all I get is a terminal that opens with the message

sh: 1: roscore: not found

and etc.

The same goes for roslaunch commands. I also fork and run the roslaunch command which doesn't work either.

I tried system("ls");

that which worked. All cout messages work the same way.

Any idea what is wrong here?

+3


source to share


1 answer


roscore executable is not in std tracks (/ bin: / usr / bin :). Use an absolute path -system("/path/to/roscore &")



+1


source







All Articles