gnuplot_i Frequently Asked Questions

What is gnuplot_i?

gnuplot_i is a C module that allows an easy interfacing to the gnuplot plotting program. In short: it allows you to send plotting requests to gnuplot from a C program.

What do I need to compile and use it?

You need a C or C++ compiler (C compiler preferred) to compile the module, nothing else.

Is there any trouble compiling it with a C++ compiler?

Some people have reported some warnings about missing casts. It seems that many C++ compilers are picky about converting pointer types. There is no generic solution to this problem. Either you are ready to modify this module by yourself to shut up all potential C++ compiler warnings (and errors), or you compile it as a C module and link your C++ programs against it.

Notice that many C++ compilers will happily compile the module without complaints, though.

How do I compile it with Visual C++?

I have no idea, I have never used this tool. What I can say is: you are trying to compile this module under Windows, which will probably fail.

Which platforms are supported?

Since gnuplot_i makes use of pipes, the notion of pipes must be present and supported by your C library for the module to compile. More specifically, the popen() system call must be supported.

Virtually all Unix flavours support this system call, so you should not have any problem using this module on Linux, Solaris, HPUX, IRIX, AIX, Tru64, BSD, etc. All POSIX-compliant platforms should also be supported, although this has not been tested.

On the other hand, Windows-based systems do not have this call, which means that the module probably does not even compile on Windows. There are several solutions around this, but they are completely unsupported. See the question below.

Does it work on Windows?

No it does not. Since Windows does not offer the popen() system call, the module does not compile under Windows.

This being said, there have been reports from people who have installed the Cygnus software suite that help emulates a Unix environment under Windows (under this environment, typical Unix system calls are supported by the compiler). They report a successful compilation and usage of gnuplot_i, although some code editing is probably needed.

Another solution is to download and install a pipe-emulation software layer to simulate the popen() system call. I have no idea how to do that and where to get the software. You are on your own, so good luck searching the Web.

Can you help me use this module under Windows?

No.

Can I replace the call to popen() by a call to system()?

Yes, but you would loose the capacity of plotting user-defined list of doubles and lists of points.