AWT with static gcj

Marco Trudel
Thu Sep 21 08:16:00 GMT 2006

Tom Tromey wrote:
>>>>>> "Marco" == Marco Trudel <> writes:
>>> In a --disable-shared build, there is no that can be
>>> loaded dynamically.
> Marco> So, libgtkpeer.a is for the shared GCJ and for the
> Marco> static? Why isn't built then?
> No... libgtkpeer.a is a static library. is a dynamic
> library.  In a --disable-shared build, the .so is simply not build.

Ok, then one short time solution will be to do something with libltdl 
and the long term solution would be to fix that in GNU classpath/GCJ so 
that will be built on --disable-shared?
Is this a big thing? Shall I fill in a bugreport?

> However, System.loadLibrary can only load dynamic libraries; static
> libraries simply can't be loaded at runtime.

Ok, now I understand. Thank you.
Stupid question (I'm not familiar with library handling):
Isn't it possible to create the dynamic lib out of this static lib?

The .a file is an ar archive, so I extracted it and got a lot of .o 
files. I compiled these with:
g++ -shared *.o -o -lgtk-X11-2.0 -lgdk-X11-2.0 -lXtst

Worked fine. Now I renamed to libgtkpeer.a and tried again 
( wasn't searched/used). I got a simple "Aborted" Message 
when trying to start a binary that uses AWT...

thanks for your time

More information about the Java mailing list