This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Executing Gcj-SWT native code fails
- From: krimo <aait at free dot fr>
- To: "java at gcc dot gnu dot org" <java at gcc dot gnu dot org>
- Date: Mon, 17 Jan 2005 13:08:45 +0100
- Subject: Executing Gcj-SWT native code fails
Hi guys,
I actually work on a SWT GUI I want to be compiled natively with gcj.
My concern is that when I launch the binary generated by gcj, no window
is visible,
however my program still run and give me the basic debug message like
("Hello").
If somebody already encountred this problem... some help will be very
appreciate:
Here is my sample code:
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
public class Test {
public static void main(String[] args){
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello World");
shell.setSize(200,100);
shell.open ();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep ();
}
display.dispose ();
}
}
And my Makefile:
gcj -c -Wall -I./lib/swt.jar --classpath=src/ src/Test.java
#Linking all
gcj --main=Test Test.o -lswt -lswt-pi -o Test
I've tested gcj-3.3 and gcj-3.4 on a debian sid. As my GUI source code,
this small example doesn't work!
Regards.