欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php安装报错 ‘gdIOCtx’ 没有名为 ‘data’ 的成员

程序员文章站 2023-12-27 15:03:27
...

在安装php时,报如下错误 In file included from /kk/php-5.4.0/ext/gd/gd.c:103: /root/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putc’: /root/php-5.4.0/ext/gd/gd_ctx.c:51: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员 /ro

在安装php时,报如下错误

In file included from /kk/php-5.4.0/ext/gd/gd.c:103:

/root/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putc’:

/root/php-5.4.0/ext/gd/gd_ctx.c:51: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/root/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putbuf’:

/root/php-5.4.0/ext/gd/gd_ctx.c:58: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/root/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_ctxfree’:

/root/php-5.4.0/ext/gd/gd_ctx.c:67: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/root/php-5.4.0/ext/gd/gd_ctx.c:68: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/root/php-5.4.0/ext/gd/gd_ctx.c:69: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/root/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_output_ctx’:

/root/php-5.4.0/ext/gd/gd_ctx.c:153: 错误:‘gdIOCtx’ 没有名为 ‘data’ 的成员

make: *** [ext/gd/gd.lo] 错误 1

解决方法

vi /include/gd_io.h

gdIOCtx结构中增加void *data;

格式如下

typedef struct gdIOCtx

{

int (*getC) (struct gdIOCtx *);

int (*getBuf) (struct gdIOCtx *, void *, int);

void (*putC) (struct gdIOCtx *, int);

int (*putBuf) (struct gdIOCtx *, const void *, int);

/* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */

int (*seek) (struct gdIOCtx *, const int);

long (*tell) (struct gdIOCtx *);

void (*gd_free) (struct gdIOCtx *);

void (*data);

}

gdIOCtx;

上一篇:

下一篇: