------- Additional Comments From laurent at bearteam dot org  2004-11-02 20:38 -------
Created an attachment (id=7461)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7461&action=view)
Sample java code

Here's how I compiled to whole thing:

cc -c  weakref.c -o weakref.o
cc -shared  -Xlinker --no-undefined weakref.o -o libweakref.so
gcj -o JNIWeakRef --main=JNIWeakRef -L . -l weakref -fjni JNIWeakRef.java

And then run with like this:

[EMAIL PROTECTED]:~/tmp/gc$ LD_LIBRARY_PATH=. ./JNIWeakRef 
Exception in thread "main" java.lang.ClassCastException:
gnu.gcj.runtime.JNIWeakRef cannot be cast to JNIWeakRef
   at _Jv_CheckCast (/usr/lib/libgcj.so.6.0.0)
   at JNIWeakRef.main(java.lang.String[]) (Unknown Source)

Sun's JVM (1.4.2) has no problem with it.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18278

Reply via email to