GCJ 3.3.1 and JNI working under Cygwin?
Martin Egholm Nielsen
martin@egholm-nielsen.dk
Mon Jun 14 12:24:00 GMT 2004
>> $ gcc -c JNITest.c (Implemented JNITest.h-methods)
>> $ gcc -o JNITest.dll -shared JNITest.o
> Please try this (it works for me with gcj 3.3.1 MinGW -- I have never
> tried it with Cygwin though):
> $ gcc -I/c/j2sdk1.4.2/include -I/c/j2sdk1.4.2/include/win32 -I. -c
> JNITest.c (adjust the path to point to your Sun JDK)
> $ gcc -Wall -shared -o JNITest.dll -D_JNI_IMPLEMENTATION_ -Wl,--kill-at
> JNITest.o
For the first command I get:
$ gcc -I/cygdrive/c/j2sdk1.4.2/include/
-I/cygdrive/c/j2sdk1.4.2/include/win32/ -I. -c JNITest.c
In file included from /cygdrive/c/j2sdk1.4.2/include/jni.h:27,
from JNITest.c:8:
/cygdrive/c/j2sdk1.4.2/include/win32/jni_md.h:16: error: syntax error
before "jlong"
/cygdrive/c/j2sdk1.4.2/include/win32/jni_md.h:16: warning: data
definition has no type or storage class
I'm not quite sure what goes wrong...
// Martin
More information about the Java
mailing list