[xml] global variables in globals.h



I'm trying to build libxml2 from source (git), and linker keeps
complaining about multiple definition of variables between SAX.c and
other source files, like this:
.libs/entities.o: In function `xmlDumpEntityContent':
f:\src\libxml2/entities.c:879: multiple definition of `forbiddenExp'
.libs/SAX.o:f:\src\libxml2/SAX.c:43: first defined here
because both SAX.c and entities.c (in this particular example) define
IN_LIBXML and include various headers (such as global.h, xmlregexp.h and
other)
According to xmlexports.h, when LIBXML_STATIC is not defined (in my case
it definitely isn't) and IN_LIBXML is defined (it is, see above),
XMLPUBVAR is defined as
    #define XMLPUBVAR __declspec(dllexport)
Interestingly, for Borland compiler XMLPUBVAR is defined as
    #define XMLPUBVAR __declspec(dllexport) extern
and changing MinGW section to use the same definition fixes multiple
definition errors for me.

Attachment: 0002-Fix-MinGW-multiple-definition-errors.patch
Description: Text document



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]