Creating "semi"-shared gcj objects for other gcj applications?

Andrew Haley aph@redhat.com
Tue Jun 8 15:55:00 GMT 2004


Andrew Haley writes:
 > Martin Egholm Nielsen writes:
 > > > > This question is somewhat related to Sal's question back in May 
 > > > > (http://gcc.gnu.org/ml/java/2004-05/msg00143.html).
 > > > > However, I just want to make shared objects for use with other gcj 
 > > > > applications.
 > > > It's all in the docs.
 > > > * When you compile your classes into a shared library they can be
 > > > automatically loaded by the `libgcj' system classloader. 
 > > Ok, thanks... I managed to get it to work using the simple commands:
 > > 
 > > $ gcj -c MYLIB.java (creates MYLIB.o)
 > > $ gcj -shared -o MYLIB.so MYLIB.o (creates the shared object MYLIB.so)
 > > $ gcj -c MyApplication.java (creates MyApplication.o)
 > > $ gcj --main=MyApplication MyApplication.o MYLIB.so (links MyApplication 
 > > with MYLIB.so)
 > 
 > No. :-)
 > 
 > Try
 > 
 > gcj -c -fPIC MYLIB.java
 > gcj -shared -o libMYLIB.so MYLIB.o
 > gcj --main=MyApplication MyApplication.o -L. -lMYLIB
Oh Lord, this is Cygwin, isn't it? I'm sorry, I know nothing about
Cygwin. This would work on Linux... :-)
Andrew.


More information about the Java mailing list

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