Compiling SWT application with GNU gcj
Michael Koch
konqueror@gmx.de
Tue Oct 11 10:07:00 GMT 2005
On Mon, Oct 10, 2005 at 11:03:02PM +0200, Andrea wrote:
> Hi all,
> I'm trying to compile a simple SWT application (nothing more than a demo
> app) with gcj but I'm having some problems in the linking phase.
>> This is what I do to compile:
>> -----------------------------------
> nivox@host:~/Test/$ gcj -fjni -c --classpath=$SWT_HOME/swt.jar
> test/swt/Test.java
>> nivox@host:~/Test/$ ls
> test Test.o
>> nivox@host:~/Test/$ gcj --main=Test ./Test.o -lswt-gtk-3138
> /tmp/ccf5eyYv.o(.text+0x12): In function `main':
> : undefined reference to `_Jv_Compiler_Properties'
> /tmp/ccf5eyYv.o(.text+0x2b): In function `main':
> : undefined reference to `Test::class$'
> /tmp/ccf5eyYv.o(.text+0x30): In function `main':
> : undefined reference to `JvRunMain'
> ./Test.o(.text+0x10): In function `test::swt::Test::main(JArray*)':
> : undefined reference to `_Jv_InitClass'
> ./Test.o(.text+0x1f): In function `test::swt::Test::main(JArray*)':
> : undefined reference to `org::eclipse::swt::widgets::Display::class$'
> ./Test.o(.text+0x24): In function `test::swt::Test::main(JArray*)':
> : undefined reference to `_Jv_AllocObjectNoFinalizer'
> ./Test.o(.text+0x2e): In function `test::swt::Test::main(JArray*)':
> : undefined reference to
> `org::eclipse::swt::widgets::Display::Display[in-charge]()'
> ./Test.o(.text+0x42): In function `test::swt::Test::main(JArray*)':
> : undefined reference to `org::eclipse::swt::widgets::Shell::class$'
> ./Test.o(.text+0x47): In function `test::swt::Test::main(JArray*)':
> : undefined reference to `_Jv_AllocObjectNoFinalizer'
> ...
> -----------------------------------
>> I have compiled with success a java program without graphic... so gcj is
> supposed to work properly.
>> Gcj --version return this:
> gcj-4.0 (GCC) 4.0.0 20050301 (prerelease) (Debian 4.0-0pre6ubuntu7)
>> I have the same problem on another machine with gcj 4.0.2 from Debian
> unstable (ppc).
>> Have someone any hint for me?
Make sure libgcj6-dev and libgcj-dev are installed. These are needed
when compiling to native (not when compiling to bytecode).
Cheers,
Michael
--
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
Join the community at http://planet.classpath.org/
More information about the Java
mailing list