Re: Compiling for multiple Linux distros

Donal Riordan <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Hi Andrew,

The test case I was using was SWT's hello world snippet so it's quite small:

public class SWT {
   public static void main (String [] args) {
      Display display = new Display ();
      Shell shell = new Shell(display);
      shell.open ();
      while (!shell.isDisposed ()) {
         if (!display.readAndDispatch ()) display.sleep ();
      }
      display.dispose ();
   }
}

Hope this helps,
Donal

Andrew Haley wrote:
> Donal Riordan wrote:
>   
>> 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.
>>     
>
> Well, I could debug it but I don't have the code, so either you'll have to
> produce a small (very small) test case that demonstrates the problem, or
> you'll have to debug it yourself.  Clearly, someone is retaining a hard
> link against libgcj, but I don't know which file it is.
>
> Andrew.
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.