Next: , Previous: , Up: Preparation   [Contents][Index]


2.2 Compiling with libfko

If you want to compile a source file including the ‘fko.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).

For example, if you installed libfko in /opt/fko, you may want to add -I/opt/fko/include to CFLAGS, or directly on the command-line:

gcc -c foo.c -I/opt/fko/include ...

The same is true when linking a program with the library. In this case, the 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).

Continuing with the example above you may want to add -L/opt/fko/lib to LDFLAGS, or directly on the command-line:

gcc -o foo foo.c -I/opt/fko/include -L/opt/fko/lib -lfko