Gnuplot & C++:在 PATH 和"

Gnuplot & C++: Can't find gnuplot neither in PATH nor in "

本文关键字:PATH C++ Gnuplot      更新时间:2023-10-16

我试图在Windows上使用Gnuplot与gnuplot_i.hpp。当我在cmd中输入"gnuplot"时,一切正常,因此PATH变量应该设置正确。这是我的代码:

#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;
}

输出是Can't find gnuplot neither in PATH或in" C:/program files/gnuplot/bin"。

当我添加

Gnuplot::set_GNUPlotPath("C:/gnuplot/bin/");

它只是改变为Can't find gnuplot neither in PATH or in "

我在这里做错了什么?

我自己找到了答案:出于某种原因,gnuplot_i.hpp希望您的exe被称为pgnuplot_exe而不是gnuplot_exe…