## Compiling libaccounts-glib applications

Building your application against libaccounts-glib is straightforward, and this documentation give some hints for those new to the process.

## Using pkg-config to query compiler and linker flags

To compile your own application which uses libaccounts-glib, you must give the compiler the location of the libaccounts-glib header files, and the linker the name of the library to link with. The easiest way to do this is to query those flags from the pkg-config file installed by libaccounts-glib. For example, to query both the compiler and linker flags, run:

    pkg-config --cflags --libs libaccounts-glib

### Note

In order for the pkg-config execution to succeed, you must have the development files for libaccounts-glib installed on your system. In most distributions, these are installed in a separate development package. Installing such packages is outside the scope of this documentation.

The `libaccounts-glib.pc` file installed by libaccounts-glib also contains several other useful variables, including the install locations for application manifest files, provider description files, service descriptions files and service type description files. Check the installed file for details, or query the list of variables with pkg-config:

    pkg-config --print-variables libaccounts-glib