The reason is probably that the environment you execute your C++ program in doesn't tell your operating system to look in the right places to find your gnuplot executable.
Try the full path to the GNU Plot executable, include the file suffix (.exe) if you're on Windows, or make sure to set the PATH environment variable to include the directory in which your gnuplot executable is.
I found the solution finally: After editing the environment variable $path, one has to restart the visual studio to get the latest value of environment variable. When I restarted my visual studio, it works.
So when ever you change your any environment variable, just restart visual studio (in case you are using it).
Thanks and kind regards,
Asked in February 2016Viewed 3,190 timesVoted 6Answered 3 times