努普洛&C ++:在PATH和"quot;"中均找不到gnuplot [英] Gnuplot & C++: Can't find gnuplot neither in PATH nor in "
问题描述
我正在Windows上使用gnuplot_i.hpp使用Gnuplot.当我在cmd中键入"gnuplot"时,一切正常,因此应正确设置PATH变量.这是我的代码:
#include< iostream>#include"gnuplot_i.hpp"使用std :: cout;使用std :: endl;int main(int argc,char * argv []){尝试 {Gnuplot g1("lines");} catch(GnuplotException ge){cout<<ge.what()<<恩德尔}返回0;}
输出是PATH和"C:/program files/gnuplot/bin"都找不到gnuplot.
添加行时
Gnuplot :: set_GNUPlotPath("C:/gnuplot/bin/");
它更改为在PATH和"中都找不到gnuplot.
我在做什么错了?
我自己找到了答案:由于某些原因,gnuplot_i.hpp希望您的exe名为pgnuplot.exe而不是gnuplot.exe ...现在一切正常./p>
I am trying to use Gnuplot on Windows with gnuplot_i.hpp. When I type "gnuplot" into cmd everthing works, so the PATH variable should be set correctly. This is my code:
#include <iostream>
#include "gnuplot_i.hpp"
using std::cout;
using std::endl;
int main(int argc, char* argv[]) {
try {
Gnuplot g1("lines");
} catch (GnuplotException ge) {
cout << ge.what() << endl;
}
return 0;
}
The output is Can't find gnuplot neither in PATH nor in "C:/program files/gnuplot/bin" .
When I add the line
Gnuplot::set_GNUPlotPath("C:/gnuplot/bin/");
it just changes to Can't find gnuplot neither in PATH nor in "".
What am I doing wrong here?
Found the answer myself: For some reason gnuplot_i.hpp expects your exe to be called pgnuplot.exe instead of gnuplot.exe ... Now everything works.
这篇关于努普洛&C ++:在PATH和"quot;"中均找不到gnuplot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!