編譯gd-2.0.35.tar.gz時報錯:gd_png.c:16:53: error: png.h: No such file or directory

編譯gd-2.0.35.tar.gz時報錯:html

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’web

解決辦法:spa

vi gd_png.c 將 #include 「png.h」              替換成: #include 「/usr/local/libpng/include/png.h」              而後再make就能夠了orm

注:include「」雙引號裏包含的是libpng安裝的路徑裏的include文件夾裏的png.h文件htm

轉自:http://hi.baidu.com/wainqaidcz/blog/item/bfc5fa53749356481138c277.htmlblog

相關文章
相關標籤/搜索