我试图从 Java 代码中使用 .NET DLL,tsMemberFunctions.DLL已成功加载,但代码无法调用实际函数。
请参阅下面的片段:
public class tsMemberFunctions {
public native void GetMemberJSONSample();
static {
System.loadLibrary("tsMemberFunctions");
System.out.println("Loaded");
}
public static void main(String[] args) {
new tsMemberFunctions().GetMemberJSONSample();
}
}
在执行上述方法时,我遇到以下错误:
Loaded
Exception in thread "main" java.lang.UnsatisfiedLinkError: tsMemberFunctions.GetMemberJSONSample()V
at tsMemberFunctions.GetMemberJSONSample(Native Method)
at tsMemberFunctions.main(tsMemberFunctions.java:12)
有人可以告诉我我是否遗漏了代码中的任何内容或任何不正确的地方,或者为此用例提出更好的替代方案。TIA。