JNIEXPORT jint JNICALL Java_CertSys_sub
JNIEXPORT jint JNICALL Java_CertSys_add
这两个函数没有实现吧?
要在.c里实现下,函数名不能改 @realmon我就是不知道这个里面该如何实现。
如果不是结构,我做过,但如果是结构,就不知道该如何做了。 @snow888
你的代码用了java的内部类,
public class Sj {
...
}
会生产2个.h文件, 应该还有个CertSys_Sj.h
找找看
@realmon没发现两个,就是一个啊。 重新javah看看是不是能生成2个.h文件
我试过了是生成2个h文件
ps.取参数的方法在jdk下的jni.h中
@snow888 @realmon
是发现两个了,分别是
"CertSys.h"/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class CertSys */
#ifndef _Included_CertSys
#define _Included_CertSys
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: CertSys
* Method: sub
* Signature: (LCertSys/Sj;)I
*/
JNIEXPORT jint JNICALL Java_CertSys_sub
(JNIEnv *, jclass, jobject);
/*
* Class: CertSys
* Method: add
* Signature: (LCertSys/Sj;)I
*/
JNIEXPORT jint JNICALL Java_CertSys_add
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif
和
"CertSys_Sj.h"/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class CertSys_Sj */
#ifndef _Included_CertSys_Sj
#define _Included_CertSys_Sj
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
下面该如何做?
@nan_jia
可我还需要在 linux 下调用 dll 的文件啊。
页:
1
[2]