解决java.lang.UnsatisfiedLinkError:dlopen failed:cannot locate symbol "tcgetattr" referenced by..
来源:互联网 发布:caffe 可视化 编辑:程序博客网 时间:2024/05/16 00:33
问题 :
09-15 12:21:41.297: D/AndroidRuntime(19825): Shutting down VM
09-15 12:21:41.297: W/dalvikvm(19825): threadid=1: thread exiting with uncaught exception (group=0x415ef898)09-15 12:21:41.297: E/AndroidRuntime(19825): FATAL EXCEPTION: main
09-15 12:21:41.297: E/AndroidRuntime(19825): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locatesymbol "tcgetattr" referenced by "xxxlib.so"...
09-15 12:21:41.297: E/AndroidRuntime(19825):at java.lang.Runtime.loadLibrary(Runtime.java:361)
09-15 12:21:41.297: E/AndroidRuntime(19825):at java.lang.System.loadLibrary(System.java:525)
分析 :
对于tcgetattr ,在termios.h中是这样定义的 :int tcgetattr(int, struct termios*);
其中结构体termios 的定义是:
struct termios {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
tcflag_t c_iflag;
tcflag_t c_oflag;
tcflag_t c_cflag;
tcflag_t c_lflag;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
cc_t c_line;
cc_t c_cc[NCCS];
};
查百度百科:
头文件 #include<termios.h>
函数原型:int tcgetattr(int fd, struct termios *termios_p);
返回值 :成功返回零;失败返回非零,发生失败接口将设置errno错误标识。
tcgetattr函数用于获取与终端相关的参数,而tcsetattr函数用于设置终端参数。参数fd为终端的文件描述符,返回的结果保存在termios 结构体中。
分析结论:所以还是库xxxlib.so编译问题造成的。
解决办法:
网上查了很多,答案参差不齐,综合别人的意见,找出了解决我的问题的办法是 :
在Android.mk中加入:
APP_PLATFORM := android-19
APP_STL := gnustl_shared
APP_STL := gnustl_shared
参考网址:
https://groups.google.com/forum/#!topic/android-ndk/usuNcsLbp14
http://forum.openframeworks.cc/t/android-master-branch/20106/2
http://qnalist.com/questions/6204640/two-similar-apps-one-works-the-other-no-ndk-not-linking-properly-why
1 1
- 解决java.lang.UnsatisfiedLinkError:dlopen failed:cannot locate symbol "tcgetattr" referenced by..
- java.lang.UnsatisfiedLinkError:dlopen failed:cannot locate symbol "tcgetattr" referenced by..
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__exidx_end" referenced by
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memclr8" referenced by
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupp
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsuppo
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupp
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy"
- UnsatisfiedLinkError: dlopen failed: cannot locate symbol “strtof” referenced by “libsupportjni.so”
- failed: dlopen failed: cannot locate symbol "rand" referenced by
- dlopen failed: cannot locate symbol "atof" referenced by "xxx.so"
- NDK java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Z12getIPAddressPcS_" refer
- ndk编译 错误:dlopen failed:cannot locate symbol "一个符号" referenced by "你的库.so/.a" lang.UnsatisfiedLinkErr
- 关于eclipse的ndk开发failed: dlopen failed: cannot locate symbol "signal" referenced
- dlopen failed: cannot locate symbol "__aeabi_memclr8"
- dlopen failed: cannot locate symbol "__aeabi_memclr4
- UnsatisfiedLinkError errordlopen failed: cannot locate symbol "rand"
- [cocos2dx]这么了三天三夜的常见的ndk编译报错 dlopen failed: cannot locate symbol "atof" referenced by
- iOS讲解迷惑深入浅出之SAX解析和JSON 解析
- html标签转义字符对照表。用于web端测试
- 防微信雷达扫描加好友控件实现
- Android开发问题集锦
- 蓝懿学习之练习日
- 解决java.lang.UnsatisfiedLinkError:dlopen failed:cannot locate symbol "tcgetattr" referenced by..
- Java Web开发Session超时设置
- Java默认修饰符
- 多媒体录制音频/视频之——MediaRecorder
- Leetcode: Shortest Word Distance III
- shiro
- Java开发中的23种设计模式详解(转)
- Android 多媒体应用:MediaRecorder 录制音视频 之 音频
- 利用百度API(JavaScript 版)实现在地图上绘制任一多边形,并判断给定经纬度是否在多边形范围内。以及两点间的测距功能