GNOME Print Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
To compile a GNOME Print application, you need to tell the compiler where to find the GNOME Print header files and libraries. This is done with the pkg-config utility.
The following interactive shell session demonstrates how pkg-config is used:
$ pkg-config --cflags libgnomeprint-2.0 -I/usr/include/libart-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libbonobo-2.0 -I/usr/include/pango-1.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libgnomeprint-2.0 -I/usr/include/orbit-2.0 -I/usr/include/linc-1.0 $ pkg-config --libs libgnomeprint-2.0 -lart_lgpl_2 -lbonobo-2 -lpango-1.0 -lbonobo-activation -lxml2 -lz -lgnomeprint-2 -lORBit-2 -lgthread-2.0 -lpthread -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lm -llinc |
The simplest way to compile a program is to use the "backticks" feature of the shell. If you enclose a command in backticks (not single quotes), then its output will be substituted into the command line before execution. So to compile a simple libgnomeprint program, you would type the following:
$ cc `pkg-config --cflags --libs libgnomeprint-2.0` gnome-print-sample.c -o gnome-print-sample |