【发布时间】:2014-05-18 18:29:46
【问题描述】:
我正在尝试从该站点实现以下代码:
https://sites.google.com/site/bettereaclone/introduction/gnuplot/c-example-gnuplot-1
代码:
#include <iostream>
#include "gnuplot_i.hpp"
#include <windows.h>
#include <conio.h>
using std::cout;
using std::endl;
int main(int argc, char* argv[])
{
try
{
Gnuplot g1("lines");
cout << "*** plotting slopes" << endl;
g1.set_title("Slopes\\nNew Line");
cout << "y = x" << endl;
g1.plot_slope(1.0,0.0,"y=x");
cout << "y = 2*x" << endl;
g1.plot_slope(2.0,0.0,"y=2x");
cout << "y = -x" << endl;
g1.plot_slope(-1.0,0.0,"y=-x");
g1.unset_title();
}
catch (GnuplotException ge)
{
cout << ge.what() << endl;
}
return 0;
}
我安装了 gnuplot (http://www.gnuplot.info/download.html)
gnuplot_i.hpp 文件 (https://code.google.com/p/gnuplot-cpp/source/browse/trunk/gnuplot_i.hpp)
当我运行这段代码时,我遇到了这个问题:
错误:
'C:/Program' 未被识别为内部或外部命令, 可运行的程序或批处理文件。
我不知道为什么。谢谢!!
【问题讨论】:
-
您正在重定向到一段代码。我建议您将问题隔离到可重现的代码 sn-p。 SO 不是代码审查论坛。
-
让我尝试解决这个问题.. 因为我真的不知道如何发布它.. 但我会解决
-
没错,是一回事!有没有办法关闭这个帖子?我标记了这个问题。