且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

UnsatisfiedLinkError:找不到正确放置在Eclipse库中的.so文件的本机方法

更新时间:2021-09-16 05:30:05

  1. loadLibrary()使用不带 "lib" 前缀的名称.

  1. loadLibrary() takes the name without "lib" prefix.

如果您不使用

If you don't use RegisterNatives(), you should name the exported functions of your native library according to javah prescriptions, e.g. Java_com_arzap_mimas_MimasJNI_MIMAS_1LoadModel.

如果本机代码是C ++,请确保导出的函数具有 extern "C" 前缀以防止名称篡改.

If the native code is C++, make sure the exported functions have extern "C" prefix to pervent name mangling.