problems with installation of XML::LibXML

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


When trying to install XML::LibXML, I get the following error:

perl-libxml-mm.c: In function `nodeC2Sv':
perl-libxml-mm.c:968: parse error before `*'
perl-libxml-mm.c:972: `decoded' undeclared (first use in this function)
perl-libxml-mm.c:972: (Each undeclared identifier is reported only once
perl-libxml-mm.c:972: for each function it appears in.)
make: *** [perl-libxml-mm.o] Error 1

I do understand that there's a problem with declarions in the C code
but i don't have any experience with this language.

Any help on how to fix this problem is very much appreciated.


Re: problems with installation of XML::LibXML

antoine wrote:

Quoted text here. Click to load it

Gee, is that still not fixed.

Look at the offending line, you'll see it's trying to do variable
declaration and assignment in one statement (C++ style).  Some C
compliers allow this.  In strict C all the variable declarations must
come directly after the opening brace of a block.  Separate the
statement into a separate declaration and assignment and move the
declaration up to just after the start of the enclosing block.

Since you couldn't be bothered to include the offending code I can't be
bothered to find it either but IIRC its soemthing like the following

   foogle *foo = bar();

You need to make it

   foogle *foo;
   foo = bar();

Re: problems with installation of XML::LibXML

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Brian McCauley wrote:

Quoted text here. Click to load it

Apparently not..

Or, just apply the attached patch.


Content-Type: text/x-patch;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

--- perl-libxml-mm.c.orig    2004-03-31 14:32:08.000000000 -0500
+++ perl-libxml-mm.c    2004-08-20 14:42:05.000000000 -0400
@@ -959,15 +959,17 @@
     if ( refnode != NULL ) {
         xmlDocPtr real_doc = refnode->doc;
         if ( real_doc != NULL && real_doc->encoding != NULL ) {
+        xmlChar *decoded;
             xs_warn( " encode node !!" );
             /* The following statement is to handle bad
                values set by XML::LibXSLT */
             if ( PmmNodeEncoding(real_doc) == XML_CHAR_ENCODING_NONE ) {
                 PmmNodeEncoding(real_doc) = XML_CHAR_ENCODING_UTF8;
-            xmlChar * decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
-                                                     (const xmlChar *)string,
-                                                     (const
+            decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
+                                           (const xmlChar *)string,
+                                           (const xmlChar*)real_doc->encoding);
             xs_warn( "push decoded string into SV" );
             len = xmlStrlen( decoded );
             retval = newSVpvn( (const char *)decoded, len );


Re: problems with installation of XML::LibXML

This patch works fine. Thanx Steven!


Site Timeline