Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

c++ - gnuplot-cpp cannot feed command to pipe

I'm using gnuplot-cpp to draw math graphs using C++. As I vaguely understand, this is an interface which feeds command to pgnuplot.exe and shows the output in another GUI.

So far, I've got the error like:

'C:Program' is not recognized as an internal or external command...

the original command of which fed to the pipe is:

"C:Program Files (x86)gnuplotin/pgnuplot.exe"

the same command executed in _access(cmd) returns TRUE for the existence of the executable whereas it returns the error described priorily when executed in _popen(cmd,"w");

I'm wondering the error comes from the cmd string format and I've tried "/", "", ""... but nothing works

the 2 code files are gnuplot_i.hpp and example.cc

Thank you in advance for any help!

Edit 01:

I've updated the two code files. They contain some of my supplementary edits

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is a known bug of gnuplot-cpp, see the issue Blanks in gnuplot path cause failure.

As workaround you can add the gnuplot directory to your PATH and call only pgnuplot.exe.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...