java调用C#的dll文件 总是报错
org.xvolks.jnative.exceptions.NativeException: Function getint not found
at org.xvolks.jnative.JNative.nLoadLibrary(Native Method)
at org.xvolks.jnative.JNative.loadLibrary(JNative.java:534)
at org.xvolks.jnative.JNative.<init>(JNative.java:510)
at org.xvolks.jnative.JNative.<init>(JNative.java:427)
at tmain.main(tmain.java:9)我的工程中导入了JNative.jar,JNativeCpp.dll放入了windows/system32目录下test.dll放入了jre/bin目录下 这是C#代码:
using System;
using System.Collections.Generic;
using System.Text;namespace test
{
public class a
{
public String getValue()
{
return "我的第一个dll文件调用陈功了";
}
public int getint()
{
return 100;
}
}
}
这是java代码:
import org.xvolks.jnative.JNative;public class tmain {
public static void main(String[] args) {
try {
System.loadLibrary("test");
JNative nGetSystemTime = new JNative("test.dll", "getint");
} catch (Exception e) {
e.printStackTrace();
} }
}
我在线上等 解决方案
org.xvolks.jnative.exceptions.NativeException: Function getint not found
at org.xvolks.jnative.JNative.nLoadLibrary(Native Method)
at org.xvolks.jnative.JNative.loadLibrary(JNative.java:534)
at org.xvolks.jnative.JNative.<init>(JNative.java:510)
at org.xvolks.jnative.JNative.<init>(JNative.java:427)
at tmain.main(tmain.java:9)我的工程中导入了JNative.jar,JNativeCpp.dll放入了windows/system32目录下test.dll放入了jre/bin目录下 这是C#代码:
using System;
using System.Collections.Generic;
using System.Text;namespace test
{
public class a
{
public String getValue()
{
return "我的第一个dll文件调用陈功了";
}
public int getint()
{
return 100;
}
}
}
这是java代码:
import org.xvolks.jnative.JNative;public class tmain {
public static void main(String[] args) {
try {
System.loadLibrary("test");
JNative nGetSystemTime = new JNative("test.dll", "getint");
} catch (Exception e) {
e.printStackTrace();
} }
}
我在线上等 解决方案
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货