Installing GD under Linux


Before installing Gd, you need to install jpeg-6b, libpng, zlib and freetype. The following is the download URL: Download Download Download Download Download


tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
make install


tar zxvf libpng-1.2.29.tar.gz
cd libpng-1.2.29
cd scripts/
mv makefile.linux ../makefile
cd ..
make install
Note that the makefile here is not used/ Configure is generated, but directly copy one from scripts /


tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
make install


tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure –enable-shared

make test
make install
Note that configure here must take the — enable shared parameter, otherwise the shared library will not be generated


tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure –with-png –with-freetype –with-jpeg

make install

If GD reports an error: configure ac:64: warning: macro `AM_ ICONV’ not found in library
Just make clean and then make

If youinstallIf other libtools are not found, you can use them from / usr / bin / libtool CP!

Compile Gd in 64 bit if / usr / bin / LD: / usr / local / lib / libz a(compress.o): relocation R_ X86_ 64_ 32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
This indicates that zlib does not use – FPIC to compile and modify zlib’s makefile cflags = – O3 – Duse_ MMAP -fPIC
make; Make install and then compile GD!