JAVA调用DLL文件运行出错。
public class JNIPKICard
{
static
{
try
{
//此处即为本地方法所在链接库名
System.loadLibrary("WinDes");
}
catch(UnsatisfiedLinkError e)
{
System.err.println( "Cannot load hello library:\n " + e.toString() );
}
}
public JNIPKICard(){}
//声明的本地方法
public native int b64_size(long size,long flag) throws Exception;
public static void main (String [] arguments)
{
try
{
long i=12;
long j=10;
int k=0;
JNIPKICard jc = new JNIPKICard ();
k=jc.b64_size(i,j);
System.out.println("This is k: " + k);
}
catch(Exception e)
{
System.err.println ("error: " + e.toString());
}
}
}
编译成功!
运行却出错。
---------- JAVA ----------
java.lang.UnsatisfiedLinkError: b64_size
at JNIPKICard.b64_size(Native Method)
at JNIPKICard.main(JNIPKICard.java:58)
Exception in thread "main"
输出完成 (耗时 0 秒) - 正常终止
请问这是什么问题。