我用libxml2
编译代码时出现编译错误。
文件Reference.h
已存在于我的代码中并被许多其他文件使用:
Reference.h
namespace reference // BEGIN OF namespace reference
{
}
但是当我使用libxml2
编译代码时,我收到错误:
libxml2/libxml/SAX.h:116: error: 'void reference(void*, const xmlChar*)' redeclared as different kind of symbol
libxml2/libxml/SAX.h
XMLPUBFUN void XMLCALL reference (void *ctx,
const xmlChar *name);
有没有办法解决这个错误而不修改我的文件Reference.h
?
谢谢你的帮助。
基本上,禁用SAX.h
。这是一个不推荐使用的接口,它不需要做任何命名空间或为其符号使用任何标准前缀。相反,使用SAX2.h
,除了其他改进之外,还使用xmlSAX2
作为前缀。
要保持已弃用的东西不被libxml2,当你运行configure
时,请确保不要传递with_legacy
选项。