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

I have a file "default.cst" and an external entity "mgr.dtd".

The XML::Parser built by me is able to parse "default.cst" onlt in 'standalone' mode, but if a refernce is made to external entity, then i get an error, as below.

Log:

-----

error in processing external entity reference at line 2, column 59, byte 82:

<?xml version="1.0" ?>

<!DOCTYPE group SYSTEM "/opt/hpcmgr/etc/templates/mgr.dtd">

--------------

I see that somehow the XML::Parser built by me is unable to parse if there is a refernce to external entity. But, drilling down further -- I found that XML::Parser requires "libexpat.<xx>" - a library used in parsing. The "libexpat" library has to be built from the "expat-2.0.1" source, which i downloaded and built.

During the make phase of "XML-Parser Module", i see a lot of warnings...

/usr/lib/hpux32/libcres.amemmove.o: section .text PROGBITS AX 8768 32 added to text segment section .IA_64.unwind UNWIND A 12 4 added to text segment section .IA_64.unwind_info PROGBITS A 36 4 added to text segment Searching library /usr/lib/hpux32/milli.a:

ld: (Warning) Unsatisfied symbol "Perl_sv_catpvn_flags" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_pop_scope" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_newSVpv" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_newSViv" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_newSVsv" in file Expat.o

ld: (Warning) Unsatisfied symbol "malloc" in file /usr/local/lib/hpux32/libexpatw.axmlparse.o

ld: (Warning) Unsatisfied symbol "realloc" in file /usr/local/lib/hpux32/libexpatw.axmlparse.o

ld: (Warning) Unsatisfied symbol "_memcpy" in file Expat.o

ld: (Warning) Unsatisfied symbol "_memcmp" in file /usr/local/lib/hpux32/libexpatw.axmlparse.o

ld: (Warning) Unsatisfied symbol "Perl_sv_newmortal" in file Expat.o

ld: (Warning) Unsatisfied symbol "memmove" in file /usr/lib/hpux32/libcres.amemmove.o

ld: (Warning) Unsatisfied symbol "_memset" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_2mortal" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_save_int" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_call_method" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_safesysmalloc" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_Tmarkstack_max_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_Tstack_sp_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_Isv_undef_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_Tstack_max_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_catpv" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_setpv" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_setiv" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_TSv_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_free_tmps" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_av_clear" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_gv_stashpv" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_setref_pv" in file Expat.o

ld: (Warning) Unsatisfied symbol "PL_memory_wrap" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_Isv_no_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "strncmp" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_free" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_Ttmps_floor_ptr" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_sv_catsv_flags" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_newSV" in file Expat.o

ld: (Warning) Unsatisfied symbol "Perl_newXS" in file Expat.o

Not sure what they mean, can i get a pointer where to start looking ?

My Environment is:

OS - HP-UX 11iv2 Arch - Itanium

  • Comment on XML::Parser: error in processing external entity reference at line ...

Replies are listed 'Best First'.
Re: XML::Parser: error in processing external entity reference at line ...
by jethro (Monsignor) on Jun 08, 2009 at 09:16 UTC
    Your linker is not finding the perl library. On my machine the symbols would be found in /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/CORE/libperl.so. You might try setting the environment variable LD_LIBRARY_PATH to the corresponding path on your machine as a quick fix.
      This could be the one possibility that the "perl library" is not getting linked. even after setting the: export LD_LIBRARY_PATH=../path/to/libperl.so it didn't help. How to verify if the linker is taking care of linking the perl library ?

        First of all you might edit your first post and put your error message between c- or code-tags, otherwise that part of your question is hardly readable

        To solve your problem you might call 'make -n' which would print all the commands make would execute (at least with most makes, hopefully yours too. Otherwise read the man page). Find the line where libcres.a is built

        One reason for the errors could be that expat doesn't know about your platform (HP-UX on Intanium) and has the wrong switches in the Makefile. So compare that line with what your compiler can understand. Try to execute the line on the shell and see if you can bring it to work, maybe by providing more switches

        Also check the documentation of expat. Is there any mention of HP-UX?

Re: XML::Parser: error in processing external entity reference at line ...
by Anonymous Monk on Jun 08, 2009 at 09:12 UTC
    The problem is with your code and xml files.
      Nope, the XML-files work fine with the older version of perl. :(
        That is weird. Error message error in processing external entity reference at line 2, column 59, byte 82 is coming from XML::Parser/expat. If it was linker error, your program wouldn't run. Does the XML-Parser test suite pass?