简体   繁体   English

不满意的链接错误

[英]Unsatisfied Link Error

Why am i getting Unsatisfied Link Error?为什么我收到不满意的链接错误?
The details are as follows:详情如下所示:

Native Method's prototype and its call in my java code is like this: Native Method的原型和它在我java代码中的调用是这样的:

private native long sampleFunction(long[][] twoDimArray, long number); private native long sampleFunction(long[][] twoDimArray, long number);

p.sampleFunction(twoDimArray, number); p.sampleFunction(twoDimArray, 数字);

Native method's prototype in VC++ code is like this: Native方法在VC++代码中的原型是这样的:

JNIEXPORT jlong JNICALL Java_MyClass_sampleFunction(JNIEnv *env, jobject obj, jobjectArray myArray, long number); JNIEXPORT jlong JNICALL Java_MyClass_sampleFunction(JNIEnv *env, jobject obj, jobjectArray myArray, long number);

Have you added the.dll you're using to the Java library path by using the JVM startup parameter -Djava.library.path=path/to/dll ?您是否使用 JVM 启动参数-Djava.library.path=path/to/dll将正在使用的 .dll 添加到 Java 库路径? If not, the JVM will not be able to link to the DLL and you will get the above error.否则,JVM 将无法链接到 DLL,您将收到上述错误。

You can also copy the.dll to the JVM lib directory if you prefer that method.如果您喜欢这种方法,也可以将 .dll 复制到 JVM lib 目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM