Thread: Re: [Java-gnome-developer] Compile natively and static in windows
Brought to you by:
afcowie
From: Joao V. <jvi...@ya...> - 2005-05-19 13:25:38
|
I think you should inform to gcj where the gtk lib (not only the jar) is, but i'm not sure... i suggest you to ask that on irc.gimp.net, at #gcj, or #classpath; where the gcj hackers hang around. Cheers, J.V. --- llanero <ll...@gm...> escreveu: > Hi all, > > does anyone know how to compile static java-gtk? A simple java app > with no java-gtk code compiles great and produces a 2.0MB (stripped) > static exe. But I can't get it to compile static with java-gtk. > > $ gcj -static -classpath gtk2.6.jar --main=Simple Simple.java > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0x8): In function > `ZN6Simple4mainEP6JArrayIPN4java4lang6StringEE': > C:/msys/1.0/home/usuari/Simple.java:20: undefined reference to > `org::gnu::gtk::WindowType::class$' > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0x7d):C:/msys/1.0/home/usuari/Simple.java:22: > undefined reference to > `org::gnu::gtk::Gtk::init(JArray<java::lang::String*>*)' > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0x8c):C:/msys/1.0/home/usuari/Simple.java:23: > undefined reference to `org::gnu::gtk::Window::class$' > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0xa1):C:/msys/1.0/home/usuari/Simple.java:23: > undefined reference to `org::gnu::gtk::WindowType::class$' > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0xaf):C:/msys/1.0/home/usuari/Simple.java:23: > undefined reference to `org::gnu::gtk::WindowType::TOPLEVEL' > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0xbe):C:/msys/1.0/home/usuari/Simple.java:23: > undefined reference to > `org::gnu::gtk::Window::Window(org::gnu::gtk::WindowType*)' > C:/DOCUME~1/usuari/CONFIG~1/Temp/cccpbaaa.o(.text+0xf4):C:/msys/1.0/home/usuari/Simple.java:25: > undefined reference to `org::gnu::gtk::Gtk::main()' > collect2: ld returned 1 exit status > > -- > Manel Clos > ll...@gm... > http://www.webpersonal.net/llanero/ __________________________________________________ Converse com seus amigos em tempo real com o Yahoo! Messenger http://br.download.yahoo.com/messenger/ |
From: Joao V. <jvi...@ya...> - 2005-05-19 13:58:15
|
--- Ismael Juma <ml...@ju...> escreveu: > Hi, > > Don't you mean #classpath in irc.freenode.net? Also I don't think #gcj > is in irc.gimp.net. Argh, you are correct. Sorry, silly mistake. Cheers, J.V. ____________________________________________________Yahoo! Mail, cada vez melhor: agora com 1GB de espaço grátis! http://mail.yahoo.com.br |
From: Joao V. <jvi...@ya...> - 2005-05-23 17:16:03
|
--- llanero <ll...@gm...> escreveu: > I have the environment built using the WindowsCompilation wiki page. I > tried with -lgtkjava and -lgtkjava2.6. No luck. > Are you able to run the example program, like it is said in the WindowsCompilation? (i mean, just run, without compiling it natively/statically). I'm asking that so we can narrow the problem. Arx and Jeff, do you have any suggestions? (i still haven't tried running JG on Windows). Cheers, J.V. ____________________________________________________Yahoo! Mail, cada vez melhor: agora com 1GB de espaço grátis! http://mail.yahoo.com.br |
From: llanero <ll...@gm...> - 2005-05-23 18:17:48
|
2005/5/23, Joao Victor <jvi...@ya...>: > Are you able to run the example program, like it is said in the WindowsCo= mpilation? (i mean, just > run, without compiling it natively/statically). I'm asking that so we can= narrow the problem. Yes, the examples work great, see below. I also can compile run applications from eclipse. I also tried: $ ld -l gtkjar2.6 c:\minGW\bin\ld.exe: cannot find -lgtkjar2.6 $ ld -l gtkjava =20 c:\minGW\bin\ld.exe: cannot find -lgtkjava Running the examples: /usr/local/src/libgtk-java-2.6.2/doc/examples $ ./runExample.sh testgtk/TestGTK Java-Gnome Example Application Launcher Checking for jvm and compiler availability... gcj and gij - appear to be ok You are using Open Source java virtual machine and compiler: this is so good! Checking if library paths exist... /usr/local/lib - appears to be ok Testing JAR archives... /usr/local/share/java/gtk2.6-2.6.2.jar - appears to be ok Compilation successful Application successfully terminated --=20 Manel Clos ll...@gm... http://www.webpersonal.net/llanero/ |
From: Nicholas R. <ni...@mn...> - 2005-05-24 10:52:34
|
There seems to be several problems with compiling natively on windows: 1. The WindowsCompilation page (which I wrote :-) says to run configure with the --without-gcj-compile option. This makes the build process skip the building of the libgtkjava library. This library is needed however if you want to compile natively with GCJ. On linux, having configured and make'd without the --without-gcj-compile option, i am able to natively compile using this command: % cd doc/examples/TestTree % gcj --classpath=/usr/local/jg-2.10/share/java/gtk2.6.jar --main=TestTree.TestTree -L/usr/local/jg-2.10/lib -lgtkjava -o TestTree TestTree.java (NOTE: i also configured using the --prefix=/usr/local/jg-2.10 option.) So, it should be the same process under windows (run configure without the --without-gcj-compile option; use the gcj line above). However there are other problems. :-) 2. The configure script will not work if you don't use the --without-gcj-compile option due to a bug in the gcj detection macros we use. I patched my version to fix the gcj detection under windows, but still have not been able to create a native executable under windows. I am going to dig deeper here as i think there are some other issues related to the gcj build process under windows, which prevents the correct creation of the libgtkjava.so library. I'll let you know once i find out more. Cheers, Nick On Mon, 2005-05-23 at 20:17 +0200, llanero wrote: > 2005/5/23, Joao Victor <jvi...@ya...>: > > Are you able to run the example program, like it is said in the WindowsCompilation? (i mean, just > > run, without compiling it natively/statically). I'm asking that so we can narrow the problem. > > Yes, the examples work great, see below. I also can compile run > applications from eclipse. > > I also tried: > > $ ld -l gtkjar2.6 > c:\minGW\bin\ld.exe: cannot find -lgtkjar2.6 > > $ ld -l gtkjava > c:\minGW\bin\ld.exe: cannot find -lgtkjava > > Running the examples: > > /usr/local/src/libgtk-java-2.6.2/doc/examples > $ ./runExample.sh testgtk/TestGTK > Java-Gnome Example Application Launcher > > Checking for jvm and compiler availability... > gcj and gij - appear to be ok > > You are using Open Source java > virtual machine and compiler: this is so good! > > Checking if library paths exist... > /usr/local/lib - appears to be ok > > Testing JAR archives... > /usr/local/share/java/gtk2.6-2.6.2.jar - appears to be ok > > Compilation successful > Application successfully terminated > > > > > |
From: Ismael J. <ml...@ju...> - 2005-05-19 13:52:16
|
On Thu, 2005-05-19 at 10:25 -0300, Joao Victor wrote: > I think you should inform to gcj where the gtk lib (not only the jar) is, but i'm not sure... i > suggest you to ask that on irc.gimp.net, at #gcj, or #classpath; where the gcj hackers hang > around. [...] Hi, Don't you mean #classpath in irc.freenode.net? Also I don't think #gcj is in irc.gimp.net. Regards, Ismael |