Re: [xml] global variables in globals.h



Hi LRN,
LRN wrote:
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.

Please cloud you provide arguments to configure command and value of variables if set. Also compiler version.

I could test this weekend with GCC 3.4.5 and 4.4.0 cross-compiler for mingw target. I'm sure that this is not case for my test build environments.

Roumen



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