I'm trying to write a really simple java app that uses JNI to access some C functions.
So far, I've got:
- my java source file (and compiled it)
- a generated header file (using javah)
- a C source file (function matches the prototype in the header file)
Now, when I try to compile the C file into a library with:
code:
gcc -mno-cygwin -I"\\cygdrive\\c\\Program Files\\Java\\jdk1.5.0_09\\include" -I"\\cygdrive\\c\\Program Files\\Java\\jdk1.5.0_09\\include\\iwn32" -Wl,--add-stdcall-alias -shared -o simple.dll simple.c
I get roughly 2000 errors/warnings in jni.h, a representative selection of them:
quote:
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1859: error: parse error before "verifyMode"
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1859: warning: data definition has no type or storage class
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1862: error: parse error before '*' token
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1862: error: `jint' declared as function returning a function
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1862: warning: data definition has no type or storage class
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1863: error: parse error before '*' token
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1864: error: parse error before '*' token
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1866: warning: data definition has no type or storage class
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1867: error: parse error before "enableVerboseGC"
/cygdrive/c/Program Files/Java/jdk1.5.0_09/include/jni.h:1867: warning: data definition has no type or storage class
Am I missing something here? Is my jni.h file corrupt somehow? Any ideas?
Thanks,
LF
--
Any sufficiently advanced bug is indistinguishable from a feature.