ansi c:windows下连接到gnuplot的管道

ansi c:windows下连接到gnuplot的管道,windows,pipe,gnuplot,Windows,Pipe,Gnuplot,希望你能帮我解决这个问题 我一直在linux下使用GNUPlot,没有任何问题,但我正在为windows开发一个项目 我已经为windows安装了gnuplot 4.6,并将gnuplot/bin添加到我的系统路径中。 我的代码编译并运行,但gnuplot没有显示任何图形 我的代码如下所示: FILE *pipe = _popen("pgnuplot -persist","w"); fprintf(pipe, "set title \"%s\"\n",plotname); fprintf(pi

希望你能帮我解决这个问题

我一直在linux下使用GNUPlot,没有任何问题,但我正在为windows开发一个项目

我已经为windows安装了gnuplot 4.6,并将gnuplot/bin添加到我的系统路径中。 我的代码编译并运行,但gnuplot没有显示任何图形

我的代码如下所示:

FILE *pipe = _popen("pgnuplot -persist","w");
fprintf(pipe, "set title \"%s\"\n",plotname); 
fprintf(pipe,"plot '-' with lines\n");

for(i = 0; i < alot ;i++)
{
    fprintf(pipe, "%d %d \n", i, data[i]); 
}

fprintf(pipe, "e");
fflush(pipe);
fclose(pipe);
FILE*pipe=_popen(“pgnuplot-persist”,“w”);
fprintf(管道,“设置标题\%s\”\n”,绘图名称);
fprintf(管道,“绘图”-“带线”);
对于(i=0;i
我尝试过使用“-noend”命令,将终端设置为windows,并使用wgnuplot.exe等,但迄今为止没有任何运气

任何帮助都将非常感激


好心的问候

不知道popen在windows上工作。这涉及多个步骤,其中任何一个都可能制造麻烦。尽量减少您的问题,找出问题的确切位置:使用一个简单的命令,例如一些创建文件的测试脚本,检查_popen调用是否有效。检查_popen函数的错误。指定pgnuplot.exe的绝对路径。使用简单的plot命令,如“plot x”。