问题
I have created a header file and a corresponding .c file full of functions I would like to use with a java program. I created a JNI header file using javah. I'm using gcc to compile my header file. How can I link my regular c object file with my JNI static library to get a static library that utilizes my C library? I'm using gcc to compile.
Here's an example of what I'm asking:
lib.h
lib.c
JNITest.h
JNITest.c (uses lib.h functions)
回答1:
You might try looking at this http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html
来源:https://stackoverflow.com/questions/2349093/static-libraries-and-jni