Static libraries and JNI

那年仲夏 提交于 2020-01-05 06:53:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!