Problem with include files in GCJ executable so that readable by getClass().getResourceAsStream()

Mohan Embar gnustuff@thisiscool.com
Sun Apr 11 23:53:00 GMT 2004


Hi Zilin,

Sorry for the delayed response.

>I used the GCC/GCJ from www.thisiscool.com and played with libgcj.dll + SWT. Thanks the great work of all people behind GCJ. It works great!
>
>But I found a problem with use libgcj.dll + SWT. I wrote a java program which using 
>
>   getClass().getResourceAsStream()
>
>to load an image file which I use
>
>   gcj --resource a.gif -c a.gif a.o
>
>compiled and linked into program.
>
>My program runs fine with the statical libgcj.a + SWT, but when with the dynamical libgcj.dll + SWT, gcj failed with:
>
>c:/msys/1.0/home/d6vaa/test/SWTPlayer/src/Player.java:599: undefined reference to `__gcj_personality_sj0'
>
>which line 599 is just the line with:
>
>   getClass().getResourceAsStream()
>
>I want to know whether anyone has the same problem or know how to work around this.

The example thisiscool-gcc/examples/HelloSWT.java does this. The Makefile for this is
in thisiscool-gcc/examples. I believe I tested this with the libgcj.dll + SWT configuration and
it worked fine. Could you examine HelloSWT.java and the makefile and see if anything is
different with your build scripts?

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/






More information about the Java mailing list