[xml] XML::LibXML on Windows



Hi everyone --

I'm trying to build perl's XML::LibXML 1.56 on Windows XP, using VC
7.0 and a downloaded binary copy of libxml 2.5.8. When it hits the
link step, I get:

     Creating library blib\arch\auto\XML\LibXML\LibXML.lib and object blib\arch\auto\XML\LibXML\LibXML.exp
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlPedanticParserDefaultValue
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlSubstituteEntitiesDefaultValue
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlLoadExtDtdDefaultValue
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlDoValidityCheckingDefaultValue
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlGetWarningsDefaultValue
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlKeepBlanksDefaultValue
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlIndentTreeOutput
  LibXML.obj : error LNK2001: unresolved external symbol __imp__xmlSaveNoEmptyTags
  dom.obj : error LNK2001: unresolved external symbol __imp__xmlGenericError
  dom.obj : error LNK2001: unresolved external symbol __imp__xmlGenericErrorContext
  blib\arch\auto\XML\LibXML\LibXML.dll : fatal error LNK1120: 10 unresolved externals
  NMAKE : fatal error U1077: 'link' : return code '0x460'
  Stop.

I found some references to this on google, with two possible
solutions:

1. -D_REENTRANT. This fails royally, with lots of errors like:
     LibXML.xs(78) : error C2375: '__xmlPedanticParserDefaultValue' : redefinition; different linkage

   (I've since been informed that the pre-built libxml 2.5.8 actually
   does have threading enabled, so _REENTRANT should be the way to go,
   but it doesn't work for me.)

2. Use a newer version of libxml. When I tried using 2.6.5, with or
   without -D_REENTRANT, I got errors like:
     LibXML.xs(78) : error C2159: more than one storage class specified
     LibXML.xs(78) : error C2375: '__xmlPedanticParserDefaultValue' : redefinition; different linkage
             ...\libxml\2.6.5\include\libxml\globals.h(375) : see declaration of 
'__xmlPedanticParserDefaultValue'

The imports in LibXML.xs look like:

  LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;
  LIBXML_DLL_IMPORT extern int xmlKeepBlanksDefaultValue;
  LIBXML_DLL_IMPORT extern int xmlLoadExtDtdDefaultValue;
  LIBXML_DLL_IMPORT extern int xmlPedanticParserDefaultValue;   <-- line 78

but if I understand correctly, in a threaded libxml these values
should be set using function calls, not external variables, and the
XML::LibXML code doesn't seem to have any provision for that. I did
find this on line 660:

  #ifdef LIBXML_THREAD_ENABLED
              xmlThrDefPedanticParserDefaultValue( 1 );
  #endif
              xmlPedanticParserDefaultValue = 1;

but PedanticParserDefaultValue is the only one of these variables that
has special coding for LIBXML_THREAD_ENABLED, and the variable
semantics are still used anyway.

I also found one message on the perl-xml list that seems to describe
the same problem: http://aspn.activestate.com/ASPN/Mail/Message/1780956
but there's no resolution listed.

Can anybody offer any advice? Thank you!

--
Ron Isaacson
Morgan Stanley

NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.



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