Click here to get back home

problems with installation of XML::LibXML

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
problems with installation of XML::LibXML antoine 06-07-2005
Get Chitika Premium
Posted by antoine on June 7, 2005, 10:30 am
Please log in for more thread options


Hi,

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.

Antoine



Posted by Brian McCauley on June 7, 2005, 7:07 pm
Please log in for more thread options




antoine wrote:

> Hi,
>
> 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.

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
pattern..

{
wibble();
foogle *foo = bar();
}

You need to make it

{
foogle *foo;
wibble();
foo = bar();
}



Posted by Steven N. Hirsch on June 8, 2005, 9:00 am
Please log in for more thread options


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

Brian McCauley wrote:

>> 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

> Gee, is that still not fixed.

Apparently not..

> 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.

Or, just apply the attached patch.

Steve

--------------000800040001070805060503
Content-Type: text/x-patch;
name="perl-libxml-mm.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="perl-libxml-mm.c.patch"

--- 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
xmlChar*)real_doc->encoding);
+ 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 );

--------------000800040001070805060503--


Posted by Antoine Janssen on June 17, 2005, 5:08 am
Please log in for more thread options


This patch works fine. Thanx Steven!

Antoine



Similar ThreadsPosted
compile problems with XML::LibXML December 22, 2004, 5:41 pm
Installation problems for Inline::C June 21, 2007, 3:32 pm
trying to resolve module installation problems November 11, 2007, 2:51 pm
Possible bug in XML:LibXML December 16, 2007, 6:22 am
LibXML and DTD's July 5, 2007, 1:26 pm
Questions about XML:LibXML December 16, 2007, 6:22 am
LibXML on Redhat 4 x64 November 20, 2008, 11:58 am
data structure from XML::LibXML October 6, 2004, 6:22 pm
namespace declarations in LibXML April 15, 2006, 12:48 am
XML::LibXML and getting data from elements/nodes October 26, 2004, 7:50 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap