Difference between revisions of "Using PLplot"

From PLplotWiki
Jump to: navigation, search
(C/C++: Added links to a win32 pkg-config binary and comments on how to use)
(C/C++: Added links to win32 wx-config binaries)
Line 14: Line 14:
  
 
Although <tt>pkg-config</tt> is not a standard Windows utility, there is a win32 binary available from [http://www.gtk.org/download-windows.html GTK] [http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-0.23-2.zip (Direct link)].  Be sure to set the <tt>PKG_CONFIG_PATH</tt> variable to the <tt><PLplot install>\lib\pkgconfig</tt> directory so it can find the PLplot files.  You will still not be able to call <tt>pkg-config</tt> directly from the gcc/g++ command since the Windows CLI does not support `` (backticks), but at least you can copy and paste the options.
 
Although <tt>pkg-config</tt> is not a standard Windows utility, there is a win32 binary available from [http://www.gtk.org/download-windows.html GTK] [http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-0.23-2.zip (Direct link)].  Be sure to set the <tt>PKG_CONFIG_PATH</tt> variable to the <tt><PLplot install>\lib\pkgconfig</tt> directory so it can find the PLplot files.  You will still not be able to call <tt>pkg-config</tt> 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 [http://wxconfig.googlepages.com/ wx-config] [http://wx-config-win.googlecode.com/svn/binary/wx-config.exe (Direct link)] may also be useful.
  
 
== Mac OS X ==
 
== Mac OS X ==
 
=== C/C++ ===
 
=== C/C++ ===

Revision as of 13:13, 16 February 2009

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++