error: png.h: No such file or directory

 

error: png.h: No such file or directory

编译gd-2.0.35.tar.gz时报错:
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/freetype/include/freetype2 –
I/usr/local/freetype/include -I/usr/local/freetype/include –
I/usr/local/jpeg/include -g -O2 -MT gd_png.lo -MD -MP -MF .deps/gd_png.Tpo -c 
gd_png.c -fPIC -DPIC -o .libs/gd_png.o
gd_png.c:16:53: error: png.h: No such file or directory
gd_png.c:47: error: expected specifier-qualifier-list before ‘jmp_buf’
gd_png.c:54: error: expected ‘)’ before ‘png_ptr’
gd_png.c:82: error: expected ‘)’ before ‘png_ptr’
gd_png.c:92: error: expected ‘)’ before ‘png_ptr’

解决办法:

vi gd_png.c

#include “png.h”             
替换成:
#include “/usr/local/libpng/include/png.h”  
           
然后再make就可以了

注:include“”双引号里包含的是libpng安装的路径里的include文件夹里

本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/836051如需转载请自行联系原作者

yangzhimingg

点赞