Skip to content

Build with libxml2 versions 2.9.0 to 2.9.3 fails #15534

Closed
@petk

Description

@petk

Description

The following code:

./buildconf
./configure
make

Resulted in this output:

In file included from /libxml2.9.3/usr/local/include/libxml2/libxml/tree.h:333,
                 from /libxml2.9.3/usr/local/include/libxml2/libxml/dict.h:16,
                 from /php-src/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c:10:
/libxml2.9.3/usr/local/include/libxml2/libxml/xmlregexp.h:123:42: error: unknown type name ‘xmlDictPtr’
  123 |                                          xmlDictPtr dict);
      |                                          ^~~~~~~~~~
In file included from /libxml2.9.3/usr/local/include/libxml2/libxml/parser.h:18,
                 from /libxml2.9.3/usr/local/include/libxml2/libxml/globals.h:18,
                 from /libxml2.9.3/usr/local/include/libxml2/libxml/threads.h:35,
                 from /libxml2.9.3/usr/local/include/libxml2/libxml/xmlmemory.h:218,
                 from /libxml2.9.3/usr/local/include/libxml2/libxml/tree.h:1307:
/libxml2.9.3/usr/local/include/libxml2/libxml/hash.h:110:42: error: unknown type name ‘xmlDictPtr’; did you mean ‘xmlDocPtr’?
  110 |                                          xmlDictPtr dict);
      |                                          ^~~~~~~~~~
      |                                          xmlDocPtr
/libxml2.9.3/usr/local/include/libxml2/libxml/parser.h:263:5: error: unknown type name ‘xmlDictPtr’
  263 |     xmlDictPtr         dict;          /* dictionnary for the parser */
      |     ^~~~~~~~~~


But I expected this output instead:

Successful build

There seems to be a change done in libxml2 2.9.4 version in <libxml/dict.h> file where the xmlDictPtr type was added before other includes so the <libxml/dict.h> can be included directly. In PHP 8.3 it works ok. PHP 8.4 with libxml2 2.9.4 also works ok. Perhaps some more includes need to be done before dict.h?

PHP Version

PHP 8.4

Operating System

Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions