This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Trying to build from a jar with gcj... many "undefinedreference" issues
- From: Anthony Green <green at redhat dot com>
- To: m h <sesquile at gmail dot com>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 21 Sep 2005 19:02:42 -0700
- Subject: Re: Trying to build from a jar with gcj... many "undefinedreference" issues
- References: <e36b84ee05092116544c82018d@mail.gmail.com>
On Wed, 2005-09-21 at 16:54 -0700, m h wrote:
> /tmp/cc9PdYTE.o(.data+0xb7e4): undefined reference to
> `org::apache::xmlrpc::WebServer::class$'
> collect2: ld returned 1 exit status
>
> I'm assumming this is just a newbie error. I've searched through the
> mailing list and google and have tried various other switches, but the
> above command appears to be the farthest that I've gotten. All of the
> "undefined reference" classes appear to be in the jars in the lib
> directory.
It's not enough to simply place those jars in your classpath. The
linker is trying to find natively compiled versions of those libraries
with no success.
You need to link your code against natively compiled versions of all of
the missing code, or switch to a much newer version of gcj and use the
new ABI (-findirect-dispatch) mechanism to build your code.
Probably the simplest approach would be to develop on Fedora Core 4,
which should come with most of those things in both bytecode and native
library form already. What platform are you currently on?
AG