Redhat编译php-5.2.9出现error dereferencing pointer to incomplete type

错误1

/usr/src/php-5.2.9/ext/dom/node.c:In function ‘dom_canonicalization‘:

/usr/src/php-5.2.9/ext/dom/node.c:1950:21: error: dereferencingpointer to incomplete type

ret = buf->buffer->use;

^

Infile included from /usr/src/php-5.2.9/main/php.h:38:0,

from/usr/src/php-5.2.9/ext/dom/node.c:26:

/usr/src/php-5.2.9/ext/dom/node.c:1952:40: error:dereferencing pointer to incomplete type

RETVAL_STRINGL((char *)buf->buffer->content, ret, 1);

^

/usr/src/php-5.2.9/Zend/zend_API.h:472:14:note: in definition of macro ‘ZVAL_STRINGL‘

char *__s=(s); int __l=l;  \

^

/usr/src/php-5.2.9/ext/dom/node.c:1952:5:note: in expansion of macro ‘RETVAL_STRINGL‘

RETVAL_STRINGL((char *)buf->buffer->content, ret, 1);

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

[[email protected]]#

错误2

/usr/src/php-5.2.9/ext/dom/documenttype.c:In function ‘dom_documenttype_internal_subset_read‘:

/usr/src/php-5.2.9/ext/dom/documenttype.c:219:42: error:dereferencing pointer to incomplete type

strintsubset =xmlStrndup(buff->buffer->content, buff->buffer->use);

^

/usr/src/php-5.2.9/ext/dom/documenttype.c:219:65: error:dereferencing pointer to incomplete type

strintsubset =xmlStrndup(buff->buffer->content, buff->buffer->use);

^

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

[[email protected]]#

解决办法:

  1. 下载https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt补丁程序
  2. 编辑/usr/src/php-5.2.9/ext/dom/node.c文件,将源代码段替换为对应的补丁代码段(表紫色部分)

---ext/dom/node.c  2012-08-06 17:49:48.826716692+0800

+++ext/dom/node.c      2012-08-0617:52:47.633484660 +0800

@@-1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA

RETVAL_FALSE;

} else {

if (mode == 0) {

#ifdef LIBXML2_NEW_BUFFER

ret =xmlOutputBufferGetSize(buf);

#else

ret = buf->buffer->use;

#endif

if (ret > 0) {

#ifdef LIBXML2_NEW_BUFFER

RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);

+#else

RETVAL_STRINGL((char *) buf->buffer->content,ret, 1);

#endif

} else {

RETVAL_EMPTY_STRING();

}

3.同理编辑/usr/src/php-5.2.9/ext/dom/documenttype.c文件,将源代码段替换为对应的补丁代码段(表紫色部分)

---ext/dom/documenttype.c   2012-08-0618:02:16.019640870 +0800

+++ext/dom/documenttype.c       2012-08-06 18:06:16.612228905+0800

@@-205,7 +205,13 @@ int dom_documenttype_internal_subset_rea

if (buff != NULL) {

xmlNodeDumpOutput (buff, NULL, (xmlNodePtr)intsubset, 0, 0, NULL);

xmlOutputBufferFlush(buff);

#ifdef LIBXML2_NEW_BUFFER

ZVAL_STRINGL(*retval,xmlOutputBufferGetContent(buff),

xmlOutputBufferGetSize(buff), 1);

#else

ZVAL_STRINGL(*retval, buff->buffer->content,buff->buffer->use, 1);

#endif

(void)xmlOutputBufferClose(buff);

return SUCCESS;

}

时间: 2024-07-31 14:33:35

Redhat编译php-5.2.9出现error dereferencing pointer to incomplete type的相关文章

解决编译错误:dereferencing pointer to incomplete type 的办法

在使用c语言写程序时,可能遇到错误:error :dereferencing pointer to incomplete type.其实,这个错误是指针指向的结构体类型没有定义. 原因可能有很多,但最多情况可能下面两种: 1,使用库函数或内核等提供的结构体时,没有包含相应的头文件.解决方法很简单,就是包含对应头文件就ok了. 2,若是自己定义的结构体,而且这个结构体恰恰是定义在.c文件中.在这种情况下,在其他.c文件中使用该结构体指针时,也会出现类似错误. 就第二种情况,笔者找到两种解决方法:

关于编译报错“dereferencing pointer to incomplete type...

今天同事问了我一个问题,他make的时候报错,“第201行:dereferencing pointer to incomplete type”,我随即查阅了很多资料,也没看出个所以然.最后问题得到了解决,也懂得了原理,遂记录一下. 他的问题具体是这样. ? 1 2 3 4 5 6 #include <netinet/ip_icmp.h> ... struct icmp* aaa;     aaa = (struct icmp*)malloc(sizeof(struct icmp)); //假设

error: invalid use of incomplete type

一般出现这种情况都是没有将用到的头文件包含进来 我的情况是在头文件中定义了一个QMenu的指针,在源文件中使用menuBar()函数来返回一个menu指针.我在源文件中包含了文件<QtGui>出现这个错误, .h QMenu *fileMenu; .cpp fileMenu = menuBar()->addMenu(tr("&File")); 解决办法是:在源文件中添加对<QMenuBar>的包含即可. error: invalid use of

Solve Error: &#39;has incomplete type&#39;, foward declaration of &#39;class x&#39;

在C++的OOB编程中,有时候我们会遇到这样的错误Error: 'has incomplete type',forward declaration of 'class x',那么是什么原因引起的这个问题呢,我们首先来看下面这段代码: // Error: field '_a' has incomplete type 'A' // forward declaration of 'class A' class A; class B { public: B(A a): _a(a) {} private:

Linux/RedHat 编译安装GNU gcc 4.9.0 (g++)

这里说的是编译安装,yum/apt-get 等安装方法比较简单,不阐述! 1.下载源码包:gcc.gnu.org 2.解压: tar -xjvf gcc-4.9.0.tar.bz2 3.下载编译所需的依赖包: 最简单的方法,直接执行: ./contrib/download_prerequisites 脚本自动下载依赖包 gmp, mpfr,mpc. 也可以手动下载然后移到/gcc-4.9.0目录下面自动一起安装,或者自行先编译安装 4.执行configure命令,产生makefile: mkdi

运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory

运行编译后的程序报错  error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory -------------------------------------------------------------------------------------------------------------------------------------

apache源码编译时报错ssl_engine_init.c:546: error: &#39;STACK&#39; undeclared (first use in this function)

操作系统:centos6.4 X86_64 apache版本:httpd-2.2.6 openssl版本:openssl-1.0.1e 源码编译apache时报如下错误: ssl_engine_init.c: In function 'ssl_init_ctx_protocol': ssl_engine_init.c:390: warning: assignment discards qualifiers from pointer target type ssl_engine_init.c:39

NDK编译c包含C++头文件 error: unknown type name &#39;class&#39; 的解决方法

在进行native开发的时候,难免会遇到C文件包含C++头文件而调用C++函数,若没做什么处理,直接include进行编译的话,会遇到以下错误: error: unknown type name 'class' error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 那么怎么解决呢? 首先,找下报错的原,从C以及C++特性不难发现:C文件include了带有C++关键字的头文件,如class等,因此,包含C

vs2012编译C代码,总是出现error C2143: syntax error : missing &#39;;&#39; before &#39;type&#39;

今天编译一个动态库,里面有用C编写的源文件, 为了调试自己加了一些简单的信息输出语句,但是总是编译不过, 最后精简到只是定义一个函数的局部变量也会编译失败, 最后Google了才明白,vs在编译C代码的时候会有一些特殊的check, 其中一种就是需要函数定义局部变量要在开头. 举例如下: 错误的代码 void func1() { int x: //do some work int y; //do other work } 这样的代码在编译的时候就会在int y 这里报error C2143: s