libgdchart-gd2 for Debian
=========================

To compile a program that uses libgdchart in Debian, the following must be
true:

   - One source file of the program must contain the following #includes:

     #include <gdc.h>
     #include <gdchart.h>
     #include <gdcpie.h>

     The program must include all three header files, even if it does not use
     gdcpie.

   - HAVE_LIBFREETYPE must be defined, regardless of whether the program uses
     libfreetype or not.

If either of the above is not true, linking will fail with unresolved symbols.
Thus, in order, for example, to get the example program, gdc_samp1.c, to
compile, you must add #include <gdcpie.h> in the code, and then run
  gcc -D HAVE_LIBFREETYPE -o gdc_samp1 gdc_samp1.c -lgdc

The reason for this is that certain global variables used by gdchart are
defined in the header files, which either declare the globals as "extern", or
actually define them, depending on a condition, namely whether GDC_LIB is
defined. The shared library installed by Debian has references to many such
globals, and these must be defined in the program.

Another problem is that if more than one source file includes the header files,
the globals will be defined multiple times. You can try specifying
  #define GDC_LIB
before the #includes in all but one source files.

  -- Antonios Christofides <anthony@itia.ntua.gr>  Fri, 9 Apr 2004 19:48:03 UTC
