This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compiling jars into libraries w/ dependencies
- To: stewart at neuron dot com
- Subject: Re: compiling jars into libraries w/ dependencies
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Fri, 04 May 2001 01:41:15 +1200
- CC: java at gcc dot gnu dot org
- References: <63899.24.15.191.21.988868450.squirrel@server1.neuron.com>
stewart@neuron.com wrote:
> I'm trying to compile jars into shared libraries which contain dependencies
> on other jars. I can compile a jar with no external dependencies, but even I
> I compile the jar which is depended on into a shared lib, I cannot seem to
> get it to be recognized.
> b.java: In class `b':
> b.java: In method `b()':
> b.java:5: Cannot find file for class c.
Even if you are linking against a shared library, you must have either source
or a class file for "c" available at compile time. So, this particular error is
happening because c.java or c.class is not visible to the compiler.
> what magic command-line do I pass to the second gcj to get it to compile?
-L. -lmyc
"-L." tells the linker to look in the current directory for things to link.
"-lmyc" tells it to link (in this case, create a dynamic link) against
libmyb.so.
regards
[ bryce ]