|
From: Mathias A. <mat...@li...> - 2011-08-24 20:46:23
|
Hello,
I have a problem with a program that runs just fine under linux but has some issues when compiling it with mingw under windows. Here is an exctract of the part which does not work as expected:
//create pipe for accessing gnuplot
FILE *pipe = popen("pgnuplot -persist","w");
//adjust settings
fprintf(pipe, "set palette gray negative\n");
//plot
fprintf(pipe, "plot 'fileX.txt' matrix with image\n");
fflush(pipe);
//close gnuplot pipe
pclose(pipe);
Under Linux I have the same code, except that I use "gnuplot" there instead of "pgnuplot". If I run this program under Windows I get two situations:
a) I get the error:
Timeout: gnuplot is not ready
Then the "graphical" gnuplot main window (haven't seen this on Linux) opens, shows just "gnuplot>" an that's it.
b) Sometimes it shows no error and the main window opens and I see that the commands which I want to execute via c++ are calles and I see the plot.
Does anybody know a solution for this problem? (The best case woult be if I would just see the "plot window" like under linux, I don't want to see the "main window" (you get it if you call wgnuplot.exe under windows).
Cheers,
Mathias
|