编译php5.3.*时报gd_compat.c:4:18: error: png.h和gd_compat.c:8:22: error: jpeglib.h错误


版本号:php-5.3.25

源码解压路径:/usr/local/src/php-5.3.25

configure能正常通过,但是在make的时候提示:

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:4:18: error: png.h: No such file or directory

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:8:22: error: jpeglib.h: No such file or directory

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c: In function 'gdJpegGetVersionInt':

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:14: error: 'JPEG_LIB_VERSION' undeclared (first use in this function)

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:14: error: (Each undeclared identifier is reported only once

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:14: error: for each function it appears in.)

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c: In function 'gdJpegGetVersionString':

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:19: error: 'JPEG_LIB_VERSION' undeclared (first use in this function)

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c: In function 'gdPngGetVersionString':

/usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c:32: error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this function)

make: *** [ext/gd/libgd/gd_compat.lo] Error 1


解决办法:

vi /usr/local/src/php-5.3.25/ext/gd/libgd/gd_compat.c

把下面2个值,修改为后面的

# include <png.h>    -->    # include </usr/local/libpng/include/png.h>

# include <jpeglib.h>    -->    # include </usr/local/jpeg/include/jpeglib.h>      


然后make clean

重新configure  、make 、make install 就可以了。


本文出自 “SmilePad” 博客,请务必保留此出处http://smilepad.blog.51cto.com/6094369/1212081

智能推荐

注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告