Running an SWT Application With gcj [message #464642] |
Fri, 25 November 2005 18:29 |
Eclipse User |
|
|
|
Originally posted by: cabhan.gmail.com
Greetings. I have written an application using SWT, but in order to
make it more available, I am hoping to get it working using gcj as well.
It should be noted that I am using Linux, and that the audience is
Linux as well.
My first error, I found a workaround for on this group that I should use
Sun's Java compiler to create the jar, and run gcj on THAT. I am
executing gcj as such:
gcj --classpath=$CLASSPATH:/usr/share/swt-3/lib/swt.jar
--main=org.cabhan.lineakconfig.Driver lineakconfig.jar
When I do this, I get errors of the following sort:
/tmp/cceuFPMI.o(.text+0x24): In function
`org::cabhan::lineakconfig::CodeWindow:
:CodeWindow(org::eclipse::swt::widgets::Display*,
org::cabhan::lineakconfig::Typ
eWindow*)':
: undefined reference to `org::eclipse::swt::widgets::Shell::class$'
/tmp/cceuFPMI.o(.text+0x4b): In function
`org::cabhan::lineakconfig::CodeWindow:
:CodeWindow(org::eclipse::swt::widgets::Display*,
org::cabhan::lineakconfig::Typ
eWindow*)':
: undefined reference to
`org::eclipse::swt::widgets::Shell::Shell(org::eclipse:
:swt::widgets::Display*)'
/tmp/cceuFPMI.o(.text+0x89): In function
`org::cabhan::lineakconfig::CodeWindow:
:CodeWindow(org::eclipse::swt::widgets::Display*,
org::cabhan::lineakconfig::Typ
eWindow*)':
I do not know how to fix these, and I cannot seem to find anyone who
can. Might anyone know?
Thank you.
- Alex
|
|
|
|
Re: Running an SWT Application With gcj [message #464655 is a reply to message #464642] |
Mon, 28 November 2005 07:33 |
ted@ted.net Messages: 3 Registered: July 2009 |
Junior Member |
|
|
hi Alex,
The following sequence works under Windows (and I believe under Linux, by
changing dll to so, but I cannot verify this at the moment).
gcj -fjni -c swt.jar
ar rc libswt.a swt.o
ranlib libswt.a (or "ar -s")
gcj -shared -fPIC -fjni -o libswt.dll swt.jar
gcj --classpath=/src -c net/ted/Test.java -o Test.o
gcj --main=Test --classpath=/src:`pwd`/swt.jar -o Test.exe Test.o
-L/`pwd` -lswt
ted@ted.net - ted.williams@windriver.com
On Fri, 25 Nov 2005 10:29:16 -0800, Alex Brick <cabhan@gmail.com> wrote:
> Greetings. I have written an application using SWT, but in order to
> make it more available, I am hoping to get it working using gcj as well.
> It should be noted that I am using Linux, and that the audience is
> Linux as well.
>
> My first error, I found a workaround for on this group that I should use
> Sun's Java compiler to create the jar, and run gcj on THAT. I am
> executing gcj as such:
>
> gcj --classpath=$CLASSPATH:/usr/share/swt-3/lib/swt.jar
> --main=org.cabhan.lineakconfig.Driver lineakconfig.jar
>
> When I do this, I get errors of the following sort:
>
> /tmp/cceuFPMI.o(.text+0x24): In function
[snip]
|
|
|
Re: Running an SWT Application With gcj [message #464711 is a reply to message #464655] |
Tue, 29 November 2005 02:20 |
Eclipse User |
|
|
|
Originally posted by: cabhan.gmail.com
Ted R Williams wrote:
>
> hi Alex,
>
> The following sequence works under Windows (and I believe under Linux,
> by changing dll to so, but I cannot verify this at the moment).
>
> gcj -fjni -c swt.jar
> ar rc libswt.a swt.o
> ranlib libswt.a (or "ar -s")
> gcj -shared -fPIC -fjni -o libswt.dll swt.jar
> gcj --classpath=/src -c net/ted/Test.java -o Test.o
> gcj --main=Test --classpath=/src:`pwd`/swt.jar -o Test.exe Test.o
> -L/`pwd` -lswt
>
> ted@ted.net - ted.williams@windriver.com
>
Here is the exact process I followed. I am operating in
~/test/swt_and_gcj, and I am beginning with .java files:
gcj -fjni -c /usr/share/swt-3/lib/swt.jar <-- Gives many warnings
about a protected handler, but otherwise works
ar rc libswt.a swt.o
ranlib libswt.a
gcj -shared -fPIC -fjni -o libswt.so /usr/share/swt-3/lib/swt.jar <--
Again, warnings, but does work
gcj --classpath=. -C *.java
^ this last step will not run, giving me errors about the SWT code.
However, I do have the libswt.so file in the current directory (as
indicated by the classpath), but it still doesn't work.
Thanks though. I also took a look at:
http://www-128.ibm.com/developerworks/java/library/j-nativeg ui2/
But that does not work either.
If you have any more ideas, let me know please. Thanks!
- Alex
|
|
|
Powered by
FUDForum. Page generated in 0.03690 seconds