This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ 3.3.1 and JNI working under Cygwin?


$ 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]