Trying to build from a jar with gcj... many "undefined reference" issues

m h sesquile@gmail.com
Thu Sep 22 17:46:00 GMT 2005


On 9/21/05, Anthony Green <green@redhat.com> wrote:
> 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.
>
Thanks for you response Anthony.
So, I need to go through each of those jars and natively compile them?
 I think I tried to do that via an eclipse plugin for gcj and ran into
all sorts of issues where not all of the dependencies for the jars I'm
depending on are satisfied. (ie, the program I want to compile uses
some classes from the jar, but other (non-used) classes (in the jars
I'm depending on) apparently require other classes/jars....). Is
there anyway to specify only building the classes you want/use? (If
not, I'm not sure I'm up for that, since the jars I pull in will
probably require more jars, etc. Another option is manually
tweaking/editing the jars and pulling out the offending/non-used
classes, but that seems like a lot of work too).
> 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.
>
I'm assumming that will require a new version of gcc? Will the
executable run on vanilla fc3 installs? Because if I can get this to
work with FC3 (a requirement) then I'll probably proceed to try and
get it to work on Suse 9.3. I can't require the end user to upgrade
gcc. My whole purpose was to try and natively compile java code so as
to remove a dependency on the jvm. But if I'm requiring a gcc
upgrade, I don't think it's worth it....
> 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?
>
As per my original post:
ps. doing this on fc3
gcj --version
gcj (GCC) 3.4.4 20050721 (Red Hat 3.4.4-2)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 thanks,
matt


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /