JNI: Library is Found on Path, but Method is not (java.lang.UnsatisfiedLinkError)

后端 未结 5 668
南笙
南笙 2021-01-12 15:43

I\'m trying to use JNI and getting java.lang.UnsatisfiedLinkError. Unlike the other million questions asked about this, I have the lib on my path, and have even seen the ex

5条回答
  •  礼貌的吻别
    2021-01-12 16:10

    The problem is with the name compiler has generated: Java_com_Tune_add@16

    Use either of two

    gcc -Wl,-kill-at

    Or

    gcc -Wl,--add-stdcall-alias

    This will ensure generation of Java_com_Tune_add

    And then your method call will be successful.

提交回复
热议问题