67,515
社区成员
发帖
与我相关
我的任务
分享
public class sotest2 {
static{
System.load("/home/user/Linux/libkk.so");
}
public native static int get();
public native static int set(int i,int j);
public static void main(String args[]){
sotest2 test = new sotest2();
int i = -1;
//int i=test.set(0,38400);
i=test.get();
System.out.println("result = "+i);
}
}
/* DO NOT EDIT THIS FILE - it is machine generated */
#include "jni.h"
/* Header for class sotest2 */
#ifndef _Included_sotest2
#define _Included_sotest2
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: sotest2
* Method: get
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_sotest2_get
(JNIEnv *, jclass);
/*
* Class: sotest2
* Method: set
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_sotest2_set
(JNIEnv *, jclass, jint, jint);
#ifdef __cplusplus
}
#endif
#endif
#include<dlfcn.h>
#include<stdio.h>
#include<stdlib.h>
#include"sotest3.h"
JNIEXPORT jint JNICALL Java_sotest2_get
(JNIEnv * env, jclass obj)
{
return 10;
}
JNIEXPORT jint JNICALL Java_sotest2_set
(JNIEnv * env, jclass obj, jint a, jint b){
return 12;
}
class Test {
static {
System.load("/lib/libtestjni.so");
}
public static native int get();
public static void main(String[] args) {
Test t = new Test();
System.out.println(t.get());
}
}
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Test */
#ifndef _Included_Test
#define _Included_Test
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: Test
* Method: get
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_Test_get
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif
#include<dlfcn.h>
#include<stdio.h>
#include<stdlib.h>
#include "Test.h"
JNIEXPORT jint JNICALL Java_Test_get
(JNIEnv* env, jobject obj) {
return 10;
}
public class sotest2 {
static{
System.load("/home/user/Linux/libkk.so");
}
public native int get();
public native int set(int i,int j);
public static void main(String args[]){
sotest2 test = new sotest2();
int i = -1;
//int i=test.set(0,38400);
i=test.get();
System.out.println("result = "+i);
}
}