If you want to compile a source file including the assuan.h header file, you must make sure that the compiler can find it in the directory hierarchy. This is accomplished by adding the path to the directory in which the header file is located to the compilers include file search path (via the -I option).
However, the path to the include file is determined at the time the source is configured. To solve this problem, libgcrypt ships with a small helper program libassuan-config that knows the path to the include file and other configuration options. The options that need to be added to the compiler invocation at compile time are output by the --cflags option to libassuan-config. The following example shows how it can be used at the command line:
gcc -c foo.c $(libassuan-config --cflags)
Adding the output of `libassuan-config --cflags' to the compiler's command line will ensure that the compiler can find the assuan.h header file.
A similar problem occurs when linking the program with the library. Again, the compiler/linker has to find the library files. For this to work, the path to the library files has to be added to the library search path (via the -L option). For this, the option --libs to libassuan-config can be used. For convenience, this option also outputs all other options that are required to link the program with the libassuan libraries (in particular, the -lassuan option). The example shows how to link foo.o with the libassuan library to a program foo.
gcc -o foo foo.o $(libassuan-config --libs)
Of course you can also combine both examples to a single command by specifying both options to libassuan-config:
gcc -o foo foo.c $(libassuan-config --cflags --libs)
If your application uses Pth or pthread, you need to pass the option --thread=pth respective --thread=pthread to the invocation of libassuan-config.