I'm trying to execute a graphviz/dot cmd from within my program,
but I'm still getting the error sh: dot: command not found.
So that's the line that matters:
system("dot -Tpng myfile.txt -o mypic.png");
Executing it on the terminal works pretty well, cause dot is set into my path variable. Trying to execute the same programmatically ends up in the described error.
Is there any trick using the system cmd where I have to mention my path additionally?
(Btw: I already did include stdlib.h, dunno wether that's important...)
Thx a lot!
You can try something like this:
#include <stdlib.h>
int main()
{
system("PATH=$PATH:<YOUR PATH TO **dot**>;<**dot** and the rest>");
}
as shocking as it seems, this works for me ... (obviously replace between < > ... )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With