Skip to main content



      Home
Home » Newcomers » Newcomers » Native compile of SWT on Linux and MacOS.... NBNBNB
Native compile of SWT on Linux and MacOS.... NBNBNB [message #27402] Thu, 10 February 2005 07:53
Eclipse UserFriend
Originally posted by: cyberdeth.spymac.com

Hi.

I downloaded the native code example from the IBM site. Did exactly like
they did and boom it breaks. This is on Linux slackware 10.0using gcj
3.3.4.

Then I tried SWT 3 for GTK on linux. And this is what I get.

[francoish@cyberdeth:~/src/Java/native/Hello] gcj -fjni --main=Hello
--classpath=./swt.jar:./swt-pi.jar -o Hello Hello.java
-Djava.library.path=. libswt-gtk-3063.so /tmp/ccMQgVpF.o(.text+0x20): In
function `Hello::main(JArray<java::lang::String*>*)':
: undefined reference to `org::eclipse::swt::widgets::Display::class$'
/tmp/ccMQgVpF.o(.text+0x33): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to
`org::eclipse::swt::widgets::Display::Display[in-charge]()'
/tmp/ccMQgVpF.o(.text+0x48): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to `org::eclipse::swt::widgets::Shell::class$'
/tmp/ccMQgVpF.o(.text+0x5f): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to
`org::eclipse::swt::widgets::Shell::Shell[in-charge](org::ec lipse::swt::widgets::Display*)'
/tmp/ccMQgVpF.o(.text+0x71): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to `org::eclipse::swt::layout::RowLayout::class$'
/tmp/ccMQgVpF.o(.text+0x84): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to
`org::eclipse::swt::layout::RowLayout::RowLayout[in-charge]( )'
/tmp/ccMQgVpF.o(.text+0xda): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to `org::eclipse::swt::widgets::Label::class$'
/tmp/ccMQgVpF.o(.text+0xf6): In function
`Hello::main(JArray<java::lang::String*>*)':
: undefined reference to
`org::eclipse::swt::widgets::Label::Label[in-charge](org::ec lipse::swt::widgets::Composite*,
int)'
collect2: ld returned 1 exit status

I'm starting to think that this SWT + GCJ native compile is a fase and
doesn't really work. My hello world example looks like this :

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 ();
}
}

Now when compiling this with java it works great but that is not what I
want. The thing is I get the same result on MacOS, so it isn't OS
specific. Please can someone throw me a friggen bone here.

Thanks
Previous Topic:plug-in development -schema
Next Topic:Running App from .bat
Goto Forum:
  


Current Time: Sun May 04 00:04:53 EDT 2025

Powered by FUDForum. Page generated in 0.07985 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top