----- Ursprüngliche Mail ----
Von: Gonzhauser <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED]
Gesendet: Dienstag, den 3. April 2007, 18:23:49 Uhr
Betreff: [Bug 102437] undefined references  with libswt3.2-gtk-gcj

Public bug reported:

Binary package hint: eclipse

Compiling the following swt hello world:

<snip>
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;

public class Hello {

    public static void main(String[] args) {
        Display display = new Display();
        final Shell shell = new Shell(display);
        RowLayout layout = new RowLayout();
        layout.justify = true;
        layout.pack = true;
        shell.setLayout(layout);
        shell.setText("Hello, World!");
        Label label = new Label(shell, SWT.CENTER);
        label.setText("Hello, World!");
        shell.pack();
        shell.open ();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) display.sleep ();
        }
       display.dispose ();
    }
}
</snip>
with

"gcj -fjni --classpath=/usr/lib/java/swt.jar -c $< -o $@"

the file Hello.o results.
However copying the file
/usr/lib/gcj/eclipse/org.eclipse.swt.gtk.linux.x86_3.2.1.v3235.jar.so
to libswt.so and linking with

"gcj --main=Hello -o Hello Hello.o -L. -lswt"

results in the following error message:

Hello.o: In function `void Hello::main(JArray<java::lang::String*>*)':
Hello.java:(.text+0x16): undefined reference to 
`org::eclipse::swt::widgets::Display::class$'
Hello.java:(.text+0x31): undefined reference to 
`org::eclipse::swt::widgets::Shell::class$'
Hello.java:(.text+0x53): undefined reference to 
`org::eclipse::swt::layout::RowLayout::class$'
Hello.java:(.text+0xb4): undefined reference to 
`org::eclipse::swt::widgets::Label::class$'
collect2: ld returned 1 exit status

If I manually compile swt jar myself with

gcj -fjni -c /usr/lib/java/swt.jar

to swt.o and link with

gcj -shared -fPIC -fjni -o libswt.o swt.o -o libswt.so

linking like above with

"gcj --main=Hello -o Hello Hello.o -L. -lswt"

works.

This is with libswt3.2-gtk-gcj, libswt3.2-gtk-java and libswt3.2-gtk-
jni.

Thanks,
GH

** Affects: eclipse (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
undefined references  with libswt3.2-gtk-gcj
https://bugs.launchpad.net/bugs/102437
You received this bug notification because you are a direct subscriber
of the bug.



                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

-- 
undefined references  with libswt3.2-gtk-gcj
https://bugs.launchpad.net/bugs/102437
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to