native的使用始终报错org.xvolks.jnative.exceptions.NativeException: Function add not foundat 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();}}}
1 回答
- 1 回答
- 0 关注
- 1133 浏览
添加回答
举报
0/150
提交
取消