This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linking problems with jar files


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]