This is the mail archive of the
java-prs@sources.redhat.com
mailing list for the Java project.
Re: gcj/376: Problem with DOM/SAX XML Parsers
- To: apbianco at cygnus dot com
- Subject: Re: gcj/376: Problem with DOM/SAX XML Parsers
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 30 Nov 2000 17:00:00 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Tom Tromey <tromey at cygnus dot com>
The following reply was made to PR gcj/376; it has been noted by GNATS.
From: Tom Tromey <tromey@cygnus.com>
To: agis@nortelnetworks.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/376: Problem with DOM/SAX XML Parsers
Date: 30 Nov 2000 10:09:08 -0700
>>>>> "Agis" == agis <agis@nortelnetworks.com> writes:
Agis> gcj --main=SAXSpeed --classpath=/root/parsers/xml/xerces.zip:/urs/local/gcj/shares/libgcj.zip:. -o SAXSpeed SAXSpeed.java
Agis> /tmp/ccIDEHfu.o: In function `SAXSpeed::print(java::lang::String *)':
Agis> /root/parsers/jars/SAXSpeed.class(.text+0xe9): undefined reference to `_CL_Q53org6apache6xerces7parsers9SAXParser'
Agis> /root/parsers/jars/SAXSpeed.class(.text+0x11b): undefined reference to `org::apache::xerces::parsers::SAXParser::SAXParser(void)'
Agis> /tmp/ccIDEHfu.o: In function `SAXSpeed::SAXSpeed(void)':
Agis> /root/parsers/jars/SAXSpeed.class(.gcc_except_table+0x14): undefined reference to `_CL_Q43org3xml3sax17SAXParseException'
Agis> /root/parsers/jars/SAXSpeed.class(.gcc_except_table+0x24): undefined reference to `_CL_Q43org3xml3sax12SAXException'
Agis> collect2: ld returned 1 exit status
Agis> It doesn't seem to find the class files, although they do exist
Agis> in the zip file and in the right directory structure. How is
Agis> that possible?
gcj generates code that assumes that the classes your program refers
to are also compiled. However, you aren't telling gcj how to link
against these programs. Putting the xerces zip file into CLASSPATH is
necessary, but not sufficient -- the compiled xerces code isn't in the
zip file.
I recommend compiling all the xerces classes and building a shared
library named `libxerces.so' from the resulting objects. Then add
`-lxerces' to your gcj command.
I'm going to close this PR since I don't believe it is actually a bug.
Tom