[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] Compiling of GCJ and SWT under MacOS X
|
Okay.
This is what I get using gcj 3.4.2 downloaded from here http://hpc.sourceforge.net/ compiling this code.
1 import org.eclipse.swt.widgets.Display;
2 import org.eclipse.swt.widgets.Shell;
3 import org.eclipse.swt.widgets.Label;
4 import org.eclipse.swt.SWT;
5 import org.eclipse.swt.layout.RowLayout;
6
7 public class Hello
8 {
9 public static void main(String[] args)
10 {
11 Display display = new Display();
12 final Shell shell = new Shell(display);
13 RowLayout layout = new RowLayout();
14 layout.justify = true;
15 layout.pack = true;
16 shell.setLayout(layout);
17 shell.setText("Hello, World!");
18 Label label = new Label(shell, SWT.CENTER);
19 label.setText("Hello, World!");
20 shell.pack();
21 shell.open ();
22 while (!shell.isDisposed())
23 {
24 if (!display.readAndDispatch()) display.sleep ();
25 }
26 display.dispose ();
27 }
[iBook:~/Development/Swt/src] cyberdet% gcj -fjni Hello.java -o Hello --main=Hello -lc
java/lang/Object.java:0: fatal error: the `java.lang.Object' that was found in `/System/Library/Frameworks/
JavaVM.framework/Versions/1.4.2/Classes/classes.jar' didn't have the special zero-length `gnu.gcj.gcj-compiled' attribute.
This generally means that your classpath is incorrectly set. Use `info gcj "Input Options"' to see the info page describing
how to set the classpath
compilation terminated.
[iBook:~/Development/Swt/src] cyberdet% gcj -fjni Hello.java -o Hello --main=Hello --classpath=$HOME/Development/
swt-classes/swt.jar -lc
/usr/bin/ld: Undefined symbols:
org::eclipse::swt::layout::RowLayout::class$
org::eclipse::swt::layout::RowLayout::RowLayout()
org::eclipse::swt::widgets::Label::class$
org::eclipse::swt::widgets::Label::Label(org::eclipse::swt::widgets::Composite*, int)
org::eclipse::swt::widgets::Shell::class$
org::eclipse::swt::widgets::Shell::Shell(org::eclipse::swt::widgets::Display*)
org::eclipse::swt::widgets::Display::class$
org::eclipse::swt::widgets::Display::Display()
collect2: ld returned 1 exit status
[iBook:~/Development/Swt/src] cyberdet% gcj -fjni Hello.java -o Hello --main=Hello --classpath=$HOME/Development/
swt-classes/swt.jar -lc -L$HOME/Development/swt-classes -lswt-carbon-3063
/usr/bin/ld: can't locate file for: -lswt-carbon-3063
[iBook:~/Development/Swt/src] cyberdet% gcj -fjni Hello.java -o Hello --main=Hello --classpath=$HOME/Development/
swt-classes/swt.jar -lc $HOME/Development/swt-classes/libswt-carbon-3063.jnilib
/usr/bin/ld: /Users/cyberdeth/Development/swt-classes/libswt-carbon-3063.jnilib is input for the dynamic link editor, is
not relocatable by the static link editor again
[iBook:~/Development/Swt/src] cyberdet% file /Users/cyberdeth/Development/swt-classes/libswt-carbon-3063.jnilib
/Users/cyberdeth/Development/swt-classes/libswt-carbon-3063.jnilib: Mach-O bundle ppc
Hope this shines some light on the subject.
Thanks
On Wed Feb 9 11:56 , Billy Biggs <vektor@xxxxxxxxxxxx> sent:
>cyberdeth@xxxxxxxxxx (cyberdeth@xxxxxxxxxx):
>
>> Hmmm. I'm going to quickly try something. will need to recompiole gcc
>> though. so will be take a while.
>>
>> So am i correct in assuming, that if you are right, that I should be
>> able to compile a SWT application without linking against any library,
>> and just by using the classpath, except if I want to link in libgcj
>> statically, you know so i don't have to ship libgcj with...
>>
>> Correct ?
>
> I think that's right. You will need to ship the SWT native libraries
>(libswt-carbon-) with your application though.
>
> -Billy
>
>_______________________________________________
>platform-swt-dev mailing list
>platform-swt-dev@xxxxxxxxxxx
>http://dev.eclipse.org/mailman/listinfo/platform-swt-dev