I had the same error. I downloaded gd 2.0.1, libpng 1.2.2, zlib 1.1.4 and compiled all three. While compiling with --with-mysql and --with-apxs works, --with-gd results in :
/bin/sh /mnt/root/usr/share/php-4.1.2/php-4.1.2/libtool --silent --mode=compile gcc -I. -I/mnt/root/usr/share/php-4.1.2/php-4.1.2/ext/gd -I/mnt/root/usr/share/php-4.1.2/php-4.1.2/main -I/mnt/root/usr/share/php-4.1.2/php-4.1.2 -I/usr/include/apache -I/mnt/root/usr/share/php-4.1.2/php-4.1.2/Zend -I/mnt/root/usr/share/php-4.1.2/php-4.1.2/ext/mysql/libmysql -I/mnt/root/usr/share/php-4.1.2/php-4.1.2/ext/xml/expat -DLINUX=22 -DEAPI -DEAPI_MM -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -I/mnt/root/usr/share/php-4.1.2/php-4.1.2/TSRM -g -O2 -prefer-pic -c gd.c
In file included from gd.c:36:
php_gd.h:69: warning: static declaration for gdImageColorResolve' follows non-static
gd.c:92: conflicting types forgdIOCtx'
/usr/include/gd_io.h:18: previous declaration of `gdIOCtx'
make[3]: *** [gd.lo] Error 1
Seems like some code is not consistent. Could it be some kind of library (mis)ordering?
The second error looks like:
in php's gd.c:92: typedef FILE gdIOCtx;
but in
/usr/include/gd_io.h:18: typedef struct gdIOCtx {... } gdIOCtx;
Could someone with more code/php experience have a look at it?
Patrick