Closed Thread Icon

Topic awaiting preservation: jni.h problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28620" title="Pages that link to Topic awaiting preservation: jni.h problem (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: jni.h problem <span class="small">(Page 1 of 1)</span>\

 
Lord_Fukutoku
Paranoid (IV) Inmate

From: San Antonio
Insane since: Jul 2002

posted posted 11-08-2006 00:21

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.

Lord_Fukutoku
Paranoid (IV) Inmate

From: San Antonio
Insane since: Jul 2002

posted posted 11-08-2006 00:26

Nevermind... I just had to post it, read it back to myself, and magically the answer comes to me.

Bonus points if you can find my stupid typo though

Now excuse me while I go beat my head against a wall...

--

Any sufficiently advanced bug is indistinguishable from a feature.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-08-2006 09:03

iwn321

Lord_Fukutoku
Paranoid (IV) Inmate

From: San Antonio
Insane since: Jul 2002

posted posted 11-08-2006 15:50

ding ding ding, we have a winner

--

Any sufficiently advanced bug is indistinguishable from a feature.

« BackwardsOnwards »

Show Forum Drop Down Menu