# Compiling and Linking against libwww

After you have installed libwww, you can use it to build Web applications. However, compiling and linking against libwww requires various command line options to be passed to your compiler and linker. These options can be hard to figure out but the `libwww-config` shell script (installed in `$exec_prefix/bin`) can help you to do some of the work. This script is based on the GTK `gtk-script` and is contributed by Søren Sandmann.

## Invoking libwww-config

After being installed, `libwww-config` takes the following flags:

`--version`
  Prints out the version of libwww installed
`--cflags`
  Prints '-I' flags pointing to the installed header files.
`--libs`
  Prints out the linker flags necessary to link a program against libwww
`--prefix[=PREFIX]`
  If `PREFIX` is specified, overrides the configured value of `$prefix`. (And of exec-prefix, unless `--exec-prefix` is also specified) Otherwise, prints out the configured value of `$prefix`
`--exec-prefix[=PREFIX]`
  If `PREFIX` is specified, overrides the configured value of `$exec_prefix`. Otherwise, prints out the configured value of `$exec_prefix`

## Example of using libwww-config

`libwww-config` can be used to compile and link a program from a configure script or directly from the command line. To compile and link a program, say one of the libwww sample programs (although these are compiled already when compiling libwww), you can do the following:

    % cd libwww
    % gcc -o test `libwww-config --cflags` Library/Examples/libapp_1.c `libwww-config --libs`