jni 调研c/c++ 动态库
1、建立java测试程序
2、得到头文件
3、编写动态库
4、数据传参
5、联调
1、建立java测试程序
public class d2JNI{
static {
//System.loadLibrary("C://Users//Qiang//IdeaProjects//untitled1//src//d2JNI.dlls"); // Load native library at runtime
// hello.dll (Windows) or libhello.so (Unixes)
}
// Declare a native method sayHello() that receives nothing and returns void
private native void d2_Simplex_PS(int num_chan, float[][] pick_time, double[][] sensor_coord, float p_velocity, float s_velocity, double[] loc_coord,float loc_time, float loc_resid, float[][] theo_time, int resid_norm, float start_disp, float max_restime);
// Test Driver
public static void main(String[] args) {
int channel = 8;
float[][] sens_pick=new float[][]{ { 1.f,0.f },{ 1.f,0.f },{ 1.f,0.f },{ 1.f,0.f },{ 1.f,0.f },{ 1.f,0.f },{ 1.f,0.f },{ 1.f,0.f } };
double[][] sens_coord=new double[][]{ { 0.,0.,0. },{ 0.,0.,1000. },{ 0.,1000.