Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

expat library issue

by coreolyn (Parson)
on Sep 09, 2003 at 21:55 UTC ( #290183=perlquestion: print w/replies, xml ) Need Help??

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

I'm stuck and hoping ye esteemed monks can open my eyes to something I'm overlooking.

We've had a routine that includes a module that utilizes XML::Twig. What makes it unusual is that it's kept in a non-standard library location for migration purposes. It use to work fine but admittedly hadn't been utilized in a long time.

Today someone wished to leverage the module and I'm getting: /usr/local/bin/perl: fatal: relocation error: file /cccharv/J +DK/Release/scripts/lib/solaris/lib/perl5/site_perl/auto/XML/Parser/Ex +pat/ symbol XML_ParserCreate_MM: referenced symbol not found

I figure either the expatlibs aren't in the PERL5LIB or LD_LIBRARY_PATH, or they are missing, or some other dumb thing. Problem is the files are where they should be and the PATH/LIB settings are correct.

So I'm a bit stuck wondering how/where to look to resolve this issue and I'm hoping someone here can boot my brain in the right direction.


Replies are listed 'Best First'.
Re: expat library issue
by asarih (Hermit) on Sep 09, 2003 at 22:03 UTC
    Are your perl and XML::Parser compatible? That is, if XML::Parser is compiled with 5.6.1 and perl was subsequently upgraded to 5.8, you'd have binary compatibility issues and you'll have to recompile XML::Parser from the source.

      Yup checked that all servers are installing the same 5.6.1 solaris package.

      I jsut had this same problem. I just downloaded expat from site which needs your valid id and password to login. Solaris package which you just have to install with pkgadd pkgname. This will add expat library which will resolve this problem.
Re: expat library issue
by mirod (Canon) on Sep 09, 2003 at 22:28 UTC

    Was expat compiled with a different compiler than the Perl you are using? The Perl that comes with Solaris is compiled with Sun's compiler, and I have been bitten before by modules compiled with gcc that refuse to work with it.

      Supposedly perlgcc addresses this very issue. I don't use it, so I don't know how well it works.
        Try to have a look at what's the compiler you are using. As the gcc compiler is not compatible with the Sun cc compiler.

        You mentioned migration in your post, which I think might partially explain why the things are failing. Are you migrating to a different SUN OS?

        Another thought, I used to get weired behaviour on my solaris system, with inconsistent ordering of /usr/local/lib and /usr/lib, etc., in the PATH and LD_LIBRARY_PATH, so one version of the program was started with another version of the so.
Re: expat library issue
by dragonchild (Archbishop) on Sep 10, 2003 at 13:26 UTC
    I'm having a similar issues with XML::Parser and expat. I have Perl 5.8 compiled on AIX for 64 bit w/threading in a non-standard location ($HOME). I compiled and installed expat using the same compiler as what I used for Perl 5.8. I then tried making XML::Parser and it complained during the link-phase that I was missing symbols .XML_Parse and .XML_(whatever). Something like 80 symbols were missing.

    Is there a problem with expat in a non-standard location?

    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Re: expat library issue
by Siblin (Initiate) on Jul 14, 2011 at 11:00 UTC

    I thought I'd post my experience of this having the same issue today.

    XML::Parser needs both the includes and the shared libraries of libexpat, but will happily compile even if you dont have the libraries in your path (as long as you have your includes), then give this error when you try and use it.

    Make sure you have both the libraries and includes when you build your make file. Include path should contain expat.h, library path should contain

    perl Makefile.PL EXPATINCPATH=/usr/sfw/include/ EXPATLIBPATH=/usr/sfw/lib/
      Beautiful. Thanks a bunch.
Re: expat library issue
by mirod (Canon) on Sep 10, 2003 at 16:11 UTC

    An other common problem with XML::Parser is that an incompatible (static) version of expat also comes with some (old) versions of Apache. If this version is in the library search path before the proper one... BANG!

    from the Axkit FAQ:

    The usual cause is currently a conflict between differing versions of expat that are being loaded at the same time. This shouldn't happen if you install expat as a shared library before you compile expat, as it will detect an installed version during configure.
    If you still get problems despite this, you might want to compile apache without expat. This is done with the following configure option:
    ./configure --disable-rule=EXPAT

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://290183]
Approved by ybiC
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2022-10-02 20:33 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (13 votes). Check out past polls.