lensman has asked for the wisdom of the Perl Monks concerning the following question:

I am still attempting to install XML::Parser on my two HP_UX systems (11.11).
I have version 1.58 of CPAN and version 4.0.2 of gcc.

I am getting a note and beaucoups errors.

The note is: Note (probably harmless): No library found for -lexpat

Then it proceeds to do the makes for XML::Parser and XML::Parser::Expat.
Later, when trying to compile Expat.c I get the errors:

Expat.xs:12:19: error: expat.h: No such file or directory
Expat.xs:60: error: syntax error before 'XML_Parser'
Expat.xs:60: warning: no semicolon at end of struct or union
Expat.xs:78: error: syntax error before ':' token
Expat.xs:79: error: syntax error before ':' token
Expat.xs:80: error: syntax error before ':' token
Expat.xs:106: error: syntax error before '}' token
Expat.xs:106: warning: data definition has no type or storage class
Expat.xs:111: error: syntax error before 'nsdelim'
.
.
.
Expat.c: In function 'XS_XML__Parser__Expat_Do_External_Parse':
Expat.c:2643: error: 'XML_Parser' undeclared (first use in this function)
Expat.c:2643: error: syntax error before 'parser'
Expat.xs:2194: error: 'cbv' undeclared (first use in this function)
Expat.xs:2194: error: syntax error before ')' token
Expat.xs:2197: error: 'parser' undeclared (first use in this function)
*** Error exit code 1
Stop.

*** Error exit code 1
Stop.

/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible

My question is: does the note have anything to do with the errors, and how do I correct?
Is there an error in the module?

I would gladly appreciate even a hint from the learned brethren.

Replies are listed 'Best First'.
Re: Another CPAN Module problem
by philcrow (Priest) on Oct 12, 2005 at 18:03 UTC
    From the docs for XML::Parser:
    This module provides ways to parse XML documents. It is built on top o +f XML::Parser::Expat, which is a lower level interface to James Clark +’s expat library.
    which means you must have the expat library for XML::Parser to work. On my linux system, the library is called libexpat.so.0.5.0 which is available through a link as libexpat.so. If you want to use the module, you must find a library (or source for it) for your platform.

    Phil

      Thanks for the timely reply. That makes sense. I was thinking along that line, but it sure feels good to hear someone else say it. Now, to play "In search of" ...
Re: Another CPAN Module problem
by dorko (Prior) on Oct 12, 2005 at 18:05 UTC
    I just installed this not too long ago. From the XML::Parser readme:
    Differences from Version 2.29
    =============================

    Expat is no longer included with this package. It must now be already installed on your system as a library. You may download the library version of expat from http://sourceforge.net/projects/expat/. After downloading, expat must be configured (an automatic script does this), built and installed.

    Cheers,

    Brent

    -- Yeah, I'm a Delt.
      Thank you, Brent! Found it. Downloaded, and installed. Still have issues, still moving up the learning curve, but I think I'm over the hump.
Re: Another CPAN Module problem
by eyepopslikeamosquito (Archbishop) on Oct 13, 2005 at 11:45 UTC

    After first installing the expat C library, into /usr/local say, install XML::Parser with:

    perl Makefile.PL EXPATLIBPATH=/usr/local/lib EXPATINCPATH=/usr/local/i +nclude make make test make install
    I did this a while ago, as discussed in Building XML::Parser and expat standalone.

      make is failing:

      gcc -c -I/usr/local/include -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_ HPUX_SOURCE -fPIC -mpa-risc-1-1 -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE _OFFSET_BITS=64 -O -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\" -fPIC "-I/opt/pe rl/lib/5.8.0/PA-RISC1.1-thread-multi/CORE" Expat.c
      In file included from Expat.xs:12:
      /usr/local/include/expat.h:18:28: error: expat_external.h: No such file or directory

      followed by a ton of syntax errors.

      where is expat_external.h supposed to come from/to be?
        I remember having that problem too.

        Googling "expat_external.h" gave me this link about expat_external.h not being copied to the right directory. I remember putting it in the right directory and everything worked, but I don't remember where I got it from... I think it gets installed, but just not copied to right directory. If you poke around, you should be able to find it and copy it over to the correct directory.

        Cheers,

        Brent

        -- Yeah, I'm a Delt.