This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: linking problems with jar files
- From: Andrew Haley <aph at redhat dot com>
- To: "Prabhakar, Vijay (IT)" <Vijay dot Prabhakar at morganstanley dot com>
- Cc: "GCJ" <java at gcc dot gnu dot org>
- Date: Wed, 2 Feb 2005 17:49:19 +0000
- Subject: Re: linking problems with jar files
- References: <B02B40763A4E244B85073170FFFE10887B6139@NYWEXMB27.msad.ms.com>
Prabhakar, Vijay (IT) writes:
> I'm having some trouble linking using gcj v3.2.3-42. Unfortunately, I
> don't really have the option to upgrade to a more recent version right
> now, but I'm willing to be that the solution would be the same -- I
> think I'm not using the correct set of switches to the linker.
>
> I have a couple of java source files which I have compiled to .class
> files using the -C option. I've taken those class files and made a JAR
> file out of them. When I try to link a program that needs those
> classes, I'm having problems linking. I cannot seem to get GCJ to
> recognize the classes or find them in the JAR file. I get errors of the
> type:
>
> : undefined reference to `Foo::printHelloWorld()'
>
> I've tried using -Ifoo.jar as well as --classpath=./foo.jar, but neither
> one seems to work. What's the correct switch to use when trying to link
> with a JAR file? I can't really compile everything to object files
> because eventually some of those JAR files will come from external
> sources.
You need to show us what you are doing, with the whole command line
and the errors you get.
Andrew.