现有一个项目,通过JNI接口调用底层库,例如:lib***.so

如下所示,总是加载不成功。调试发现,每次加载so库,会跳到catch异常处理部分,然后打印异常log信息。

static{  try{System.load("/data/data/com.***/lib/lib***.so");}  catch(UnsatisfiedLinkError ulink){ Log.i("HVnative====","Can not load library");ulink.printStackTrace();}}


arm-none-linux-gnueabi-ld工具发现有些函数未定义,如下所示:

snowdream@snowdream:~/workspace/$ arm-none-linux-gnueabi-ld lib***.soarm-none-linux-gnueabi-ld: warning: libc.so, needed by lib***.so, not found (try using -rpath or -rpath-link)arm-none-linux-gnueabi-ld: warning: libdvm.so, needed by lib***.so, not found (try using -rpath or -rpath-link)lib***.so: warning: the use of `tmpnam' is dangerous, better use `mkstemp'arm-none-linux-gnueabi-ld: warning: cannot find entry symbol _start; defaulting to 00008248lib***.so: undefined reference to `__aeabi_fadd'lib***.so: undefined reference to `__aeabi_fdiv'lib***.so: undefined reference to `__aeabi_fcmpge'lib***.so: undefined reference to `__aeabi_dcmpgt'lib***.so: undefined reference to `__aeabi_dcmpeq'lib***.so: undefined reference to `__aeabi_uidiv'lib***.so: undefined reference to `__aeabi_ui2d'lib***.so: undefined reference to `__aeabi_dcmple'lib***.so: undefined reference to `__aeabi_fcmplt'lib***.so: undefined reference to `__aeabi_i2d'lib***.so: undefined reference to `__aeabi_uidivmod'lib***.so: undefined reference to `__aeabi_fmul'lib***.so: undefined reference to `__aeabi_d2uiz'lib***.so: undefined reference to `__aeabi_fcmpeq'lib***.so: undefined reference to `__aeabi_d2iz'lib***.so: undefined reference to `__aeabi_dcmpge'lib***.so: undefined reference to `__aeabi_ldivmod'lib***.so: undefined reference to `__aeabi_d2f'lib***.so: undefined reference to `__aeabi_dmul'lib***.so: undefined reference to `__aeabi_dcmplt'lib***.so: undefined reference to `__aeabi_f2d'lib***.so: undefined reference to `__aeabi_fcmple'lib***.so: undefined reference to `__aeabi_idivmod'lib***.so: undefined reference to `__aeabi_fsub'lib***.so: undefined reference to `__aeabi_ddiv'lib***.so: undefined reference to `__aeabi_ui2f'lib***.so: undefined reference to `__aeabi_i2f'lib***.so: undefined reference to `__aeabi_idiv'lib***.so: undefined reference to `__aeabi_dadd'lib***.so: undefined reference to `__aeabi_fcmpgt'lib***.so: undefined reference to `__aeabi_dsub'lib***.so: undefined reference to `__aeabi_f2iz'


如果“ undefined reference to” 后面打印的函数是:
1、 你自己写的函数,那么你应该去检查自己所写的这段代码有何问题,修改之后,再重新编译底层库;

2、系统函数,暂时还没找到合适的解决办法,正在努力寻求方法。


更多相关文章

  1. Android对第三方类库运行时加载
  2. android 限制adb的访问目录
  3. 图片加载框架-Picasso最详细的使用指南
  4. TranslateAnimation动画
  5. android ViewPager动态加载问题
  6. android系统启动及wifi框架分析
  7. 第十三篇 Android(安卓)系统电话管理机制与架构二
  8. android 6.0 logcat机制(二)logcat从logd中获取log保存到文件中
  9. web app 第三方登录-微博登录(二)

随机推荐

  1. 关于Android隐式启动Activity的分析和说
  2. Android初小试--Hello World
  3. Android中自定义DialogFragment解决宽度
  4. android statusbar隐藏的几种方式
  5. android获取当前运行Activity名字的方法
  6. 常见Android笔试题
  7. android android:duplicateParentState="
  8. Android(安卓)Studio + smalidea进行smai
  9. Eclipse添加Android系统库
  10. Android 新建xml文档用来保存配置信息