This information is taken directly from the GD documentation.
gd is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and write out the result as a .GIF file. This is particularly useful in World Wide Web applications, where .GIF is the format used for inline images.
Compile your application with the flag
and link using the flags
Note: To use version 1.3 regardless of the current system default, use
/opt/gd-1.3/OS/[include|lib], where OS is the output of the command