Compiling for multiple Linux distros

Donal Riordan riordan@effor-dev.org
Sun Mar 16 21:31:00 GMT 2008


Hi, sorry to re-open this problem but compiling SWT applications for 
multiple distros is proving troublesome.
For my test case I'm trying to compile a simple 'hello world' swt app on 
Ubuntu and have the executable run on a fresh Fedora installation (it's 
a vm-ware image in case that matters).
On Ubuntu I compile the libswt.a library using:
gcj -c -findirect-dispatch -fjni swt.jar -o libswt.a
and then compile my application using:
gcj -fjni -findirect-dispatch -classpath swt.jar --main=SWT SWT.java -o 
swt-ubuntu -L. -Wl,--no-whole-archive -lswt
The resultant executable works fine in Ubuntu but when I try to execute 
it in Fedora I get libgcj linking problems again:
error while loading shared libraries: libgcj.so.81: cannot open shared 
object file: No such file or directory
I've been able to compile non-SWT programs in Ubuntu such that they run 
correctly on Fedora - I only encounter this problem when I try to use SWT.
Any and all suggestions welcome.
Thanks,
Donal
Andrew Haley wrote:
> Donal Riordan wrote:
>>> Hello all,
>>>> I'm trying to compile a simple hello world program to an executable that
>> will work on both my test distros; Ubuntu 7.10 & Fedora 8. Everything
>> works fine when I compile and execute on the same system but I cannot
>> execute a binary on Ubuntu when it was compiled in Fedora and vice-versa.
>>>> Running the Fedora binary on Ubuntu generates the error:
>> error while loading shared libraries: libgcj.so.8rh: cannot open shared
>> object file: No such file or directory
>>>> Running the Ubuntu binary on Fedora generates:
>> libgcj failure: gcj linkage error.
>> Incorrect library ABI version detected. Aborting.
>>>> Compile everything with -findirect-dispatch.
>> Andrew.
>>


More information about the Java mailing list

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