2

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 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

In the file 'gnuplot_i.hpp', change the variable value to refer to gnuplot.exe:- std::string Gnuplot::m_sGNUPlotFileName = "gnuplot.exe";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.