线程“ main”中的异常java.lang.UnsatisfiedLinkError:proiectP.JavatoC.getval(I)I

这是我的代码,我已将.dll添加到Java_Home所在的位置。我有这个错误:

线程“主”中的异常java.lang.UnsatisfiedLinkError:proiectP.JavatoC.getval(n)上的proiectP.JavatoC.getval(I)I   方法)在proiectP.JavatoC.main(JavatoC.java:19)
 public class JavatoC{

   public native int getval(int b);
   static
     {System.loadLibrary("main");
     }
   public static void main(String[] args) {

      try {
        int a;
        int b=3;
        a= new JavatoC().getval(b); 
        System.out.println(a);   
      }catch(Exception e)
      {
          System.out.println(e);
      }
    }
  }

I also tried to write a= new proiectP.JavatoC().getval(b) as proiectP is the package. It doesn't work.

评论