I'm just learning how to use the JNI and have been following the tutorial provided by Sun. My knowledge of C and its compilation system is very limited (I'm a Java generation programmer) I try to create a dll using the method proposed by the tutorial like this:
cl -Ic:program files\java\jdk1.5.0_09\ include
-Ic:program files\java\jdk1.5.0_09\include\win32
-LD HelloWorldImp.c
-Fehello.dll
I get an error message stating
fatal error C1083: Cannot open include file: 'jni.h': No such file or directory
The code is identical to the tutorial's code.
I am running Windows XP and Microsoft Visual C++ 6.0
The preprocessor statement where the error is located is
#include <jni.h>
and this is the very first line in the c program named HelloWorldImp.c
I fixed this problem by just placing a copy of jni.h into the same directory, but a slew of other problems followed, and I don't think that that is a very good practice to get into anyway.
I have set the paths of the directories of the include and include/win32 in my environment variables, because I don't know what else to do and I believe in luck. This also proved to be a miserable disgrace. How can I get the c file to compile into a dll? I know that this seems to be more of a c problem than a java problem, but I've compiled my share of c programs without difficulty. And I know that this seems like a pretty elementary problem, but my mother loves me anyway.
Thanks for any help on the issue :)
-Daniel