java.lang.UnsatisfiedLinkError - JNI

前端 未结 3 1969
太阳男子
太阳男子 2021-01-21 18:43

I keep getting a java.lang.UnsatisfiedLinkError error every time I run my program. I have a native, a wrapper, and the program to call the native through the wrapper.<

3条回答
  •  天涯浪人
    2021-01-21 19:09

    I think the problem is that your JNI signature doesn't match. That is:

    JNIEXPORT void JNICALL native_MessageBox(string text, string title);
    

    should be something like:

    JNIEXPORT void JNICALL java_com_example_Wrapper_native_MessageBox(string text, string title);
    

    where, java_com_example should be replaced with your package name (. to be replace with _ in package name).

    OR

    I would suggest you to generate your native function signature and declaration using javah -jni option available in java.

提交回复
热议问题