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

筅森魡賤 提交于 2021-02-10 06:14:21

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/39390303/gnuplot-c-cant-find-gnuplot-neither-in-path-nor-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!