0

我不明白如何将 xmlXPathDistinct 用于 xmllib2

// xmlNodeSetPtr    xmlXPathDistinct    (xmlNodeSetPtr nodes)


xmlXPathObjectPtr result;
...
if(result) {       
    xmlNodeSetPtr nodeset = xmlXPathDistinct(result->nodesetval);

    --> warning: initialization makes pointer from integer without a cast

有人可以给我一个例子吗?

里卡多

编辑:gcc -o test2 test2.c -L/usr/local/lib xml2-config --cflags --libs-lpthread -m64

Linux mymachine 2.6.32-358.23.2.el6.x86_64 #1 SMP 2013 年 10 月 16 日星期三 18:37:12 UTC x86_64 x86_64 x86_64 GNU/Linux

4

1 回答 1

0

好的,找到了。必须包含所有这些标题

 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libxml/valid.h>
 #include <libxml/hash.h>
 #include <libxml/xmlerror.h>
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 #include <libxml/parserInternals.h>
 #include <libxml/uri.h>
 #include <libxml/xpointer.h>
于 2013-11-21T17:06:43.430 回答