Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

undefined reference: compiling swt using gcj

843810May 9 2006 — edited Sep 25 2006
Hello guys

I'm trying to make an exe from a java code, using GCJ and SWT

My code is this:
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

public class TestExe {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Display display = new Display();
	    Shell shell = new Shell(display);
	   

		MessageBox message = new MessageBox(shell,SWT.OK|
			    SWT.CANCEL|
			    SWT.ICON_WARNING);
		
		message.setText("Message from SWT");
       message.setMessage("hello");
       message.open();

	}

}
It is just a simple hello world class using swt...

I compile doing this:
gcj -c -I/cygdrive/f/gcc40-20051104/thisiscool-gcc/swt/win32/3138/swt.jar --classpath=. TestExe.java

gcj --main=TestExe TestExe.o -L/cygdrive/f/gcc40-20051104/thisiscool-gcc/swt/win32/3138 -lswt -o TestExe.exe


and I get the error:
...undefined reference to 'TestExe::class$'


I think I've looked at all the articles on google about how to compile swt with GCJ, but I never find a satisfying answer.
I know there is something wrong in my commands, even if I did a lot of possible combinations...

can someone help me here? I spent to much time looking for the answer, and now I'm tired :-(

Thanks for any help
Philippe
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2006
Added on May 9 2006
3 comments
213 views