native的使用始终报错?

native的使用始终报错

org.xvolks.jnative.exceptions.NativeException: Function add not found
at org.xvolks.jnative.JNative.nLoadLibrary(Native Method)
at org.xvolks.jnative.JNative.<init>(JNative.java:348)
at org.xvolks.jnative.JNative.<init>(JNative.java:269)
at NewTest.main(NewTest.java:13)
JNativeCpp.dll放在对应的位置了,可以确定的是调用的库中存在该函数,请高手指教

附代码:
import org.xvolks.jnative.JNative;
import org.xvolks.jnative.Type;
import org.xvolks.jnative.exceptions.NativeException;

public class NewTest 

public static void main(String[] args) throws NativeException, IllegalAccessException
{
JNative n = null;
try
{
//System.loadLibrary("jnative");
n = new JNative("jnative.dll", "add");
n.setRetVal(Type.INT); 
n.setParameter(0 ,1) ; 
n.setParameter(1, 2); 
n.invoke();
System.out.println(n.getDLLName());
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
if(n!=null)
n.dispose();
}
}
}

温温酱
浏览 1144回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP