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] | |
The problem is in:
/mnt/hda1/eclipse/workspace/nativeCompiler/SWT-LinuxGTK/libswtnative.a
You need to wrap the native part in a whole archive option, in order to force its inclusion:
-Wl,--whole-archive /mnt/hda1/eclipse/workspace/nativeCompiler/SWT-LinuxGTK/libswtnative.a -Wl,--no-whole-archive
Without the whole-archive option, you the linker will not include any of
libswtnative.a functions, because they are only referenced dynamically through
_Jv_LookupJNIMethod(). At compile time, the linker can't see they are actually being
used, and he will drop them from the executable you are creating. By the way, this
works exactly the same as on win32.
Not enough. The libraries required are (for gtk/x11):I've added these libraries to my link options, and still have more failed dependencies then I wish to list here. I'll keep plugging away at it, but there's still something that I'm missing out on.
-lgtk-x11-2.0 \ -lgdk-x11-2.0 \ -latk-1.0 \ -lgdk_pixbuf-2.0 \ -lm \ -lpangoxft-1.0 \ -lpangox-1.0 \ -lpango-1.0 \ -lgobject-2.0 \ -lgmodule-2.0 \ -ldl \ -lglib-2.0 \ -lgthread-2.0 \ -lpthread
Add these link options to your linking instruction.
This is just crazy. Forcing a dependency on a GCJ shared library eliminates much of the advantage of native compilation in the first place (deployment without a JRE). I received an offline email earlier today from Norbert Frese, describing how he got around this problem. I really appreciated that, but didn't have much luck when trying that advice... I'll dive back into it once I get things working "normally".Won't work. When you link with gcj, it will issue the ld linker instructions which will link libgcj.so anyway. So, linking libgcj.a *and* libgcj.so twice will cause the error you encountered:
libgcj failure: Duplicate class registration: java.lang.Class Aborted
You can't just simply link statically on linux with libgcj.a. It requires re-building gcj with the configuration option. It is not well-supported though.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |