## GNet for developers

## Compiling programs with GNet

If you are a developer and you want to use GNet in your program, you can use the pkg-config script to figure out which flags need to set when compiling. For example, type `gcc main.c `pkg-config gnet --cflags --libs`` to compile the program main.c with GNet and link it to GNet.

If you use autoconf and automake, you can the pkg-config macros to set the appropriate variables. Just add this to your configure.in:

    PKG_CHECK_MODULES(GNET, gnet > 2.0.0,
      [LIBS="$LIBS $GNET_LIBS" CFLAGS="$CFLAGS $GNET_CFLAGS"],
      AC_MSG_ERROR(Cannot find GNet: Is gnet-config in path?))