On Mon, 12 Nov 2007 14:41:02 -0800, Carl Worth wrote:
> I'm compiling it with:
>
>         gcj -I /usr/share/java/swt-gtk-3.3.1.jar -lswt -lswt-pi \
>         --main=org.eclipse.swt.snippets.Snippet1 -o Snippet1 Snippet1.java
>
> which works, but running the resulting binary just segfaults with the
> backtrace below.

I was able to fix this by using the following compilation flags
instead:

        gcj -I /usr/share/java/swt-gtk-3.3.1.jar -lswt \
        --main=org.eclipse.swt.snippets.Snippet1 -o Snippet1 Snippet1.java

That is, by *not* linking against libswt-pi.

I had originally gotten those linker flags from:

        $ pkg-config --libs swt-gtk
        -lswt -lswt-pi

So I don't know if /usr/lib/pkgconfig/swt-gtk.pc is broken to be
listing -lswt-pi or if there's something broken about libswt-pi
somehow.

Interestingly, I noticed that even a trivial System.out.println
"hello, world" program will segfault if linked against both libswt and
libswt-pi, (without even referencing any symbols from either library).

-Carl

Attachment: pgpk9gbliX5F2.pgp
Description: PGP signature

Reply via email to