gnuplot-cpp不能将命令馈送到管道 [英] gnuplot-cpp cannot feed command to pipe
问题描述
我使用gnuplot-cpp来绘制使用C ++的数学图形。正如我非常清楚地了解,这是一个接口,它向pgnuplot.exe提供命令,并在另一个GUI中显示输出。
I'm using gnuplot-cpp to draw math graphs using C++. As I vaguely understand, this is an interface which feeds command to pgnuplot.exe and shows the output in another GUI.
到目前为止,我遇到的错误是:
So far, I've got the error like:
'C:\Program' is not recognized as an internal or external command...
提供给管道的原始命令是:
the original command of which fed to the pipe is:
"C:\Program Files (x86)\gnuplot\bin/pgnuplot.exe"
在_access(cmd)中执行的同一命令对于可执行文件的存在返回TRUE,而在_popen(cmd,w);
the same command executed in _access(cmd) returns TRUE for the existence of the executable whereas it returns the error described priorily when executed in _popen(cmd,"w");
我想知道错误来自cmd字符串格式,我试过/,\,\\...但没有什么工作
I'm wondering the error comes from the cmd string format and I've tried "/", "\", "\\"... but nothing works
这两个代码文件是 gnuplot_i.hpp 和 example.cc
感谢您提供任何帮助!
编辑01:
我更新了两个代码文件。它们包含我的一些补充修改
I've updated the two code files. They contain some of my supplementary edits
推荐答案
这是 gnuplot-cpp
,请参阅 gnuplot路径中的空白会导致失败。
作为解决方法,您可以将gnuplot目录添加到 PATH
,并仅调用 pgnuplot.exe
。
As workaround you can add the gnuplot directory to your PATH
and call only pgnuplot.exe
.
这篇关于gnuplot-cpp不能将命令馈送到管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!