Executing Gcj-SWT native code fails

krimo aait@free.fr
Mon Jan 17 13:31:00 GMT 2005


Jakob Praher a écrit :

>Am Montag, den 17.01.2005, 13:08 +0100 schrieb krimo:
>  
>
>>Hi guys,
>>
>>    
>>
>
>  
>
>>And my Makefile:
>>        gcj -c -Wall -I./lib/swt.jar --classpath=src/ src/Test.java
>>        #Linking all
>>        gcj --main=Test Test.o -lswt -lswt-pi -o Test
>>
>>    
>>
>how did you compile libswt.so and libswt-pi.so, did you mention the
>-fjni flag (this classes contain native code, which is implemented using
>jni), do you have a LD_LIBRARY_PATH for the jni shared objects ?
>
>  
>
I'm using librairies included in the swingwt debian package and I 
suppose that the -fjni flag is set.
I also tried to compile swingwt 0.85 myself (I verified the Makefile and 
the -fjni flag is set) to get
libswt compiled with -fjni. Unfortunately, libswt is linked with 
libswt-mozilla-gtk-3063.so that contains unresolved symbols:
/tmp/SwingWT/lib/linux_gtk2/libswt-mozilla-gtk-3063.so: undefined 
reference to `nsCString::nsCString[in-charge]()'
/tmp/SwingWT/lib/linux_gtk2/libswt-mozilla-gtk-3063.so: undefined 
reference to `vtable for nsQueryInterface'
/tmp/SwingWT/lib/linux_gtk2/libswt-mozilla-gtk-3063.so: undefined 
reference to `nsCString::nsCString[in-charge](char const*, int)'
/tmp/SwingWT/lib/linux_gtk2/libswt-mozilla-gtk-3063.so: undefined 
reference to `nsString::nsString[in-charge](unsigned short const*)'
/tmp/SwingWT/lib/linux_gtk2/libswt-mozilla-gtk-3063.so: undefined 
reference to `nsString::AssignWithConversion(char const*)'
/tmp/SwingWT/lib/linux_gtk2/libswt-mozilla-gtk-3063.so: undefined 
reference to `nsString::nsString[in-charge]()'
I didn't set the LD_LIBRARY_PATH. At All, I don't have any errors or 
warnings

>I don't have a problem using swt gui stuff, but I've tested with
>gcc-head recently. Also I've found that compiling swt.jar with the old
>abi (which is the only one in gcc-3.4) I have some strange verifier
>error.
>
>Do you get an error, or simply nothing?
>
>  
>
Here is an example of the execution with a System.out.println("Hello"); 
added just after shell.open();:

hostname:/home/me/projects/GUISWT# ./Test
Hello

and that's all... I got no errors or warnings at the compilation or 
execution steps, that's why I really don't understand...

I'm using:
gcj both 3.4 & 3.3
libgcj4 required by libswt.so












More information about the Java mailing list