linking problems with jar files

Andrew Haley aph@redhat.com
Wed Feb 2 17:49:00 GMT 2005


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.


More information about the Java mailing list

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