- edited description
Cannot build php 5.3.18 with ilbgd on CentOS 6.3
Hello everybody, I tried to build php 5.3.18 with libgd using commands:
./configure --prefix=/usr/php --enable-exif --with-gd=/usr/local --with-png-dir=/usr/local --with-jpeg-dir=/usr/local
make -j4
And I got errors during second command:
In file included from /root/php-5.3.18/ext/gd/gd.c:58: /root/php-5.3.18/ext/gd/libgd/gd_compat.h:43: error: nested redefinition of ‘enum gdPixelateMode’ /root/php-5.3.18/ext/gd/libgd/gd_compat.h:43: error: redeclaration of ‘enum gdPixelateMode’ /root/php-5.3.18/ext/gd/libgd/gd_compat.h:44: error: redeclaration of enumerator ‘GD_PIXELATE_UPPERLEFT’ /usr/local/gd.h:781: note: previous definition of ‘GD_PIXELATE_UPPERLEFT’ was here /root/php-5.3.18/ext/gd/libgd/gd_compat.h:46: error: redeclaration of enumerator ‘GD_PIXELATE_AVERAGE’ /usr/local/gd.h:783: note: previous definition of ‘GD_PIXELATE_AVERAGE’ was here /bin/sh /root/php-5.3.18/libtool --silent --preserve-dup-deps --mode=compile gcc -I/usr/local/ -Iext/gd/ -I/root/php-5.3.18/ext/gd/ -DPHP_ATOM_INC -I/root/php-5.3.18/include -I/root/php-5.3.18/main -I/root/php-5.3.18 -I/root/php-5.3.18/ext/date/lib -I/root/php-5.3.18/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/include -I/usr/include/freetype2 -I/usr/local/ -I/root/php-5.3.18/ext/mbstring/oniguruma -I/root/php-5.3.18/ext/mbstring/libmbfl -I/root/php-5.3.18/ext/mbstring/libmbfl/mbfl -I/root/php-5.3.18/TSRM -I/root/php-5.3.18/Zend -I/usr/local/include -g -O2 -fvisibility=hidden -c /root/php-5.3.18/ext/gd/libgd/gd_compat.c -o ext/gd/libgd/gd_compat.lo make: *** [ext/gd/gd.lo] Error 1
GD was installed with libjpeg and libpng:
#libjpeg
wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar -xzf jpegsrc.v8d.tar.gz
cd jpeg-8d
./configure --prefix=/usr/local
make -j4
make install
#libpng
tar -xzf libpng-1.5.13.tar.gz
cd libpng-1.5.13
./configure --prefix=/usr/local
make -j4
make install
#GD
hg clone https://bitbucket.org/pierrejoye/gd-libgd
cd gd-libgd/
mkdir build
cd build
echo "cmake_policy(SET CMP0002 OLD)" >> ../CMakeLists.txt
cmake ..
make -j4
make install
Does anybody know how to fix this? Thanks in advance
Comments (5)
-
reporter -
reporter - edited description
-
Use "--with-gd" to build against the bundled library.
There is a bug that prevents build against external lib.
-
reporter Works like a charm :) Thanks a lot!
-
- changed status to resolved
using bundled gd.
- Log in to comment