Using PLplot

From PLplotWiki
Revision as of 14:13, 16 February 2009 by Altendky (Talk | contribs) (C/C++: Added links to win32 wx-config binaries)

Jump to: navigation, search

The next step after you have successfully managed to configure and build the PLplot library is to build your own program using PLplot. Basically one has to tell the compiler where to find the include files and the library. This depends on the programming language you use and the platform you are working one. It's always a good idea to have a look in the Makefiles which on Linux are based in /usr/local/share/plplot/examples/language if you installed PLplot in the standard location.

Linux

C/C++

If the pkg-config is available and CMake found it during the configuration stage than programs might be compiled for C via:

gcc `pkg-config --cflags --libs plplotd` prog.c -o prog

For C++:

g++ `pkg-config --cflags --libs plplotd-c++` prog.cpp -o prog


Windows

C/C++

Although pkg-config is not a standard Windows utility, there is a win32 binary available from GTK (Direct link). Be sure to set the PKG_CONFIG_PATH variable to the <PLplot install>\lib\pkgconfig directory so it can find the PLplot files. You will still not be able to call pkg-config directly from the gcc/g++ command since the Windows CLI does not support `` (backticks), but at least you can copy and paste the options.

If you built PLplot with the wxWidgets driver, a win32 binary of wx-config (Direct link) may also be useful.

Mac OS X

C/C++