Compiling Libdexter Applications

Compiling Libdexter Applications — How to compile your Libdexter application

Compiling Libdexter Applications on UNIX

Libdexter uses pkg-config to provide information to the compiler and linker for building your applications.

The following interactive shell session demonstrates how pkg-config is used (your output may differ):

$ pkg-config --cflags dexter
-I/usr/include/dexter -I/usr/include/dexterplugin -I/usr/include/dexterpublic -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
$ pkg-config --libs dexter
-ldexter -ldexterplugin -lgobject-2.0 -lglib-2.0

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. For example:

$ gcc `pkg-config --cflags --libs dexter` -o myprogram myprogram.c

You can also create a Makefile to compile your programs. For example:

CFLAGS=`pkg-config --cflags --libs dexter`

myprogram:	myprogram.c
		$(CC) $(CFLAGS) -o $@ $<

Then just issue the command:

$ make myprogram
gcc `pkg-config --cflags --libs dexter` -o myprogram myprogram.c

You may also use the GNU build system tools: autoconf, automake and libtool.

Refer to the GNU documentation of those tools for more information.