藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 系統管理


    

藍森林 http://www.lslnet.com 2006年8月18日 15:18


如何給gd庫添加png

png庫安裝的是libpng-1.2.8

gd庫編譯確認找到png庫,但make的時候報錯
gd_png.c:46: parse error before "jmp_buf"
gd_png.c:46: warning: no semicolon at end of struct or union
gd_png.c:48: warning: data definition has no type or storage class
gd_png.c:50: parse error before "gdPngJmpbufStruct"
gd_png.c:50: warning: data definition has no type or storage class
gd_png.c:53: parse error before "png_ptr"
gd_png.c: In function `gdPngErrorHandler':
gd_png.c:55: `jmpbuf_ptr' undeclared (first use in this function)
gd_png.c:55: (Each undeclared identifier is reported only once
gd_png.c:55: for each function it appears in.)
gd_png.c:66: `msg' undeclared (first use in this function)
gd_png.c:69: `png_ptr' undeclared (first use in this function)
gd_png.c: At top level:
gd_png.c:83: parse error before "png_ptr"
gd_png.c: In function `gdPngReadData':
gd_png.c:85: `data' undeclared (first use in this function)
gd_png.c:85: `length' undeclared (first use in this function)
gd_png.c:85: `png_ptr' undeclared (first use in this function)
gd_png.c: At top level:
gd_png.c:89: parse error before "png_ptr"
gd_png.c: In function `gdPngWriteData':
gd_png.c:91: `data' undeclared (first use in this function)
gd_png.c:91: `length' undeclared (first use in this function)
gd_png.c:91: `png_ptr' undeclared (first use in this function)
gd_png.c: At top level:
gd_png.c:95: parse error before "png_ptr"
gd_png.c: In function `gdImageCreateFromPngCtx':
gd_png.c:122: `png_byte' undeclared (first use in this function)
gd_png.c:122: parse error before "sig"
gd_png.c:123: `png_structp' undeclared (first use in this function)
gd_png.c:124: `png_infop' undeclared (first use in this function)
gd_png.c:125: `png_uint_32' undeclared (first use in this function)
gd_png.c:128: `png_colorp' undeclared (first use in this function)
gd_png.c:128: parse error before "palette"
gd_png.c:129: `png_color_16p' undeclared (first use in this function)
gd_png.c:131: `png_bytep' undeclared (first use in this function)
gd_png.c:133: `png_bytepp' undeclared (first use in this function)
gd_png.c:145: `sig' undeclared (first use in this function)
gd_png.c:150: `png_ptr' undeclared (first use in this function)
gd_png.c:150: `PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
gd_png.c:161: `info_ptr' undeclared (first use in this function)
gd_png.c:176: request for member `jmpbuf' in something not a structure or union
gd_png.c:189: `width' undeclared (first use in this function)
gd_png.c:189: `height' undeclared (first use in this function)
gd_png.c:191: `PNG_COLOR_TYPE_RGB' undeclared (first use in this function)
gd_png.c:192: `PNG_COLOR_TYPE_RGB_ALPHA' undeclared (first use in this function)
gd_png.c:204: `image_data' undeclared (first use in this function)
gd_png.c:205: `row_pointers' undeclared (first use in this function)
gd_png.c:215: `PNG_COLOR_TYPE_PALETTE' undeclared (first use in this function)
gd_png.c:216: `palette' undeclared (first use in this function)
gd_png.c:221: `PNG_INFO_tRNS' undeclared (first use in this function)
gd_png.c:229: `trans' undeclared (first use in this function)
gd_png.c:243: `PNG_COLOR_TYPE_GRAY' undeclared (first use in this function)
gd_png.c:244: `PNG_COLOR_TYPE_GRAY_ALPHA' undeclared (first use in this function)
gd_png.c:247: parse error before "gdMalloc"
gd_png.c:273: `trans_gray_rgb' undeclared (first use in this function)
gd_png.c:291: case label not within a switch statement
gd_png.c:292: case label not within a switch statement
gd_png.c:298: `trans_color_rgb' undeclared (first use in this function)
gd_png.c:289: break statement not within loop or switch
gd_png.c:308: break statement not within loop or switch
gd_png.c: At top level:
gd_png.c:311: warning: parameter names (without types) in function declaration
gd_png.c:311: warning: data definition has no type or storage class
gd_png.c:314: `png_ptr' undeclared here (not in a function)
gd_png.c:314: `info_ptr' undeclared here (not in a function)
gd_png.c:314: initializer element is not constant
gd_png.c:314: warning: data definition has no type or storage class
gd_png.c:315: parse error before "if"
gd_png.c:318: parse error before '&' token
gd_png.c:325: parse error before '&' token
gd_png.c:326: warning: parameter names (without types) in function declaration
gd_png.c:326: conflicting types for `gdFree'
gd.h:495: previous declaration of `gdFree'
gd_png.c:326: warning: data definition has no type or storage class
gd_png.c:327: parse error before "return"
gd_png.c:336: warning: parameter names (without types) in function declaration
gd_png.c:336: warning: data definition has no type or storage class
gd_png.c:337: parse error before '(' token
gd_png.c:343: `im' undeclared here (not in a function)
gd_png.c:343: warning: data definition has no type or storage class
gd_png.c:344: parse error before "for"
gd_png.c:349: `i' undeclared here (not in a function)
gd_png.c:349: conflicting types for `open'
gd_png.c:343: previous declaration of `open'
gd_png.c:349: warning: data definition has no type or storage class
gd_png.c:350: parse error before '}' token
gd_png.c:362: parse error before '&' token
gd_png.c:372: parse error before "g"
gd_png.c:372: `row_pointers' undeclared here (not in a function)
gd_png.c:372: `j' undeclared here (not in a function)
gd_png.c:372: `boffset' undeclared here (not in a function)
gd_png.c:372: warning: data definition has no type or storage class
gd_png.c:373: parse error before "b"
gd_png.c:373: `row_pointers' undeclared here (not in a function)
gd_png.c:373: `j' undeclared here (not in a function)
gd_png.c:373: `boffset' undeclared here (not in a function)
gd_png.c:373: warning: data definition has no type or storage class
gd_png.c:374: parse error before '->;' token
gd_png.c:385: parse error before "g"
gd_png.c:385: redefinition of `g'
gd_png.c:372: `g' previously defined here
gd_png.c:385: `row_pointers' undeclared here (not in a function)
gd_png.c:385: `j' undeclared here (not in a function)
gd_png.c:385: `boffset' undeclared here (not in a function)
gd_png.c:385: warning: data definition has no type or storage class
gd_png.c:386: parse error before "b"
gd_png.c:386: redefinition of `b'
gd_png.c:373: `b' previously defined here
gd_png.c:386: `row_pointers' undeclared here (not in a function)
gd_png.c:386: `j' undeclared here (not in a function)
gd_png.c:386: `boffset' undeclared here (not in a function)
gd_png.c:386: warning: data definition has no type or storage class
gd_png.c:390: parse error before "a"
gd_png.c:391: `row_pointers' undeclared here (not in a function)
gd_png.c:391: `j' undeclared here (not in a function)
gd_png.c:391: `boffset' undeclared here (not in a function)
gd_png.c:391: warning: data definition has no type or storage class
gd_png.c:392: parse error before '->;' token
gd_png.c:404: `idx' undeclared here (not in a function)
gd_png.c:404: conflicting types for `open'
gd_png.c:349: previous declaration of `open'
gd_png.c:404: warning: data definition has no type or storage class
gd_png.c:405: parse error before '}' token
gd_png.c:425: warning: parameter names (without types) in function declaration
gd_png.c:425: warning: data definition has no type or storage class
gd_png.c:426: warning: parameter names (without types) in function declaration
gd_png.c:426: warning: data definition has no type or storage class
gd_png.c:428: parse error before "return"
gd_png.c: In function `gdImagePngCtxEx':
gd_png.c:484: `png_byte' undeclared (first use in this function)
gd_png.c:484: parse error before "trans_values"
gd_png.c:485: `png_color_16' undeclared (first use in this function)
gd_png.c:486: `png_color' undeclared (first use in this function)
gd_png.c:487: `png_structp' undeclared (first use in this function)
gd_png.c:488: `png_infop' undeclared (first use in this function)
gd_png.c:493: `png_ptr' undeclared (first use in this function)
gd_png.c:493: `PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
gd_png.c:505: `info_ptr' undeclared (first use in this function)
gd_png.c:509: `png_infopp' undeclared (first use in this function)
gd_png.c:514: request for member `jmpbuf' in something not a structure or union
gd_png.c:580: `PNG_INTERLACE_ADAM7' undeclared (first use in this function)
gd_png.c:580: `PNG_INTERLACE_NONE' undeclared (first use in this function)
gd_png.c:587: `PNG_COLOR_TYPE_RGB_ALPHA' undeclared (first use in this function)
gd_png.c:588: `PNG_COMPRESSION_TYPE_DEFAULT' undeclared (first use in this function)
gd_png.c:589: `PNG_FILTER_TYPE_DEFAULT' undeclared (first use in this function)
gd_png.c:594: `PNG_COLOR_TYPE_RGB' undeclared (first use in this function)
gd_png.c:602: `PNG_COLOR_TYPE_PALETTE' undeclared (first use in this function)
gd_png.c:608: `trans_rgb_value' undeclared (first use in this function)
gd_png.c:657: `trans_values' undeclared (first use in this function)
gd_png.c:679: `palette' undeclared (first use in this function)
gd_png.c:710: `png_bytep' undeclared (first use in this function)
gd_png.c:710: `row_pointers' undeclared (first use in this function)
gd_png.c:716: `prow_pointers' undeclared (first use in this function)
gd_png.c:727: parse error before "gdMalloc"
gd_png.c: At top level:
gd_png.c:764: parse error before "else"
gd_png.c:769: `row_pointers' used prior to declaration
gd_png.c:769: `png_bytep' undeclared here (not in a function)
gd_png.c:769: `height' undeclared here (not in a function)
gd_png.c:769: warning: initialization makes integer from pointer without a cast
gd_png.c:769: initializer element is not constant
gd_png.c:769: warning: data definition has no type or storage class
gd_png.c:770: parse error before "if"
gd_png.c:788: warning: parameter names (without types) in function declaration
gd_png.c:788: warning: data definition has no type or storage class
gd_png.c:789: warning: parameter names (without types) in function declaration
gd_png.c:789: warning: data definition has no type or storage class
gd_png.c:791: parse error before "for"
gd_png.c:793: warning: parameter names (without types) in function declaration
gd_png.c:793: warning: data definition has no type or storage class
gd_png.c:794: parse error before '}' token
gd_png.c:798: warning: parameter names (without types) in function declaration
gd_png.c:798: warning: data definition has no type or storage class
gd_png.c:799: parse error before '}' token
gd_png.c:802: parse error before '&' token
gd_png.c:802: warning: data definition has no type or storage class
gd_png.c:404: storage size of `open' isn't known
make[2]: *** [gd_png.lo] Error 1
make[2]: Leaving directory `/home/soft/gd-2.0.26'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/soft/gd-2.0.26'
make: *** [all] Error 2

如何給gd庫添加png

可否給出全部編譯過程?包括準備工作、configure 的參數、make 等等

如何給gd庫添加png

編譯
./configure --prefix="/usr/local/gd" --with-png="/usr/local/png" --with-jpeg="/usr/local/jpeg" --with-freetype="/usr/local/freetype2"

返回結果:
** Configuration summary for gd 2.0.33:

   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   no
   Support for Xpm library:          no
   Support for pthreads:             yes

configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/Makefile
config.status: creating config/gdlib-config
config.status: creating test/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands


再執行make
在執行png的時候就出錯了.信息就我前面貼出的帖子.

如何給gd庫添加png

可否將編譯 gd 時候的提示部分貼全,以待分析

如何給gd庫添加png

前面PNG安裝成功
我修改了gd_png.c中include(png.h)為include(/usr/local/png/include/png.h)
然後make通過.
/usr/local/png/為我安裝PNG庫的目錄

如何給gd庫添加png

哦,你沒有指定 png 的 include 目錄

如何給gd庫添加png

我想應該是安裝PNG的時候我選擇了目錄,如果是默認安裝的話,可能在便宜GD的時候就不需要修改此文件了吧.

如何給gd庫添加png

本人寫了個在在redhat 9.0中如何使PHP支持GD庫筆記,想使php支持GD庫遇到困難的朋友可以到http://www.518good.com/view.php?page=1&tid=155上看看.

如何給gd庫添加png

用 apt 或者 yum 的話,一句話就搞定了 ^_^

如何給gd庫添加png

rpm



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com