使用NDK编译的时候出现 undefined reference to
2016-02-03 10:36
489 查看
引用:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Add the line
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
to the Android.mk file and it should work. As explained in the ndk doc, it is because the ndk performs a debug checking even for avoiding runtime linking error and for some motivations it doesn't find the
correct references in a pre-built library. Hope it coulds help.
http://stackoverflow.com/questions/7209971/ndk-build-undefined-reference-to-errors-when-statically-linking-to-libxml-a
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
PS:
Android.mk文件来向NDK编译系统描述你的源代码
Application.mk文件向NDK编译系统描述你的应用程序需要的原生代码。
objdump -j .text -Sl objtest | more
-S 尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,
效果比较明显。隐含了-d参数。
-l 用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用
使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求
编译时使用了-g之类的调试编译选项。
-j name 仅仅显示指定section的信息
同时发现objdump这个指令功能强大,下面是几个我认为常用的option:
objdump -x obj 以某种分类信息的形式把目标文档的数据组织(被分为几大块)输出
objdump -t obj 输出目标文档的符号表
objdump -h obj 输出目标文档的section概括
Add the line
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
to the Android.mk file and it should work. As explained in the ndk doc, it is because the ndk performs a debug checking even for avoiding runtime linking error and for some motivations it doesn't find the
correct references in a pre-built library. Hope it coulds help.
http://stackoverflow.com/questions/7209971/ndk-build-undefined-reference-to-errors-when-statically-linking-to-libxml-a
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
PS:
Android.mk文件来向NDK编译系统描述你的源代码
Application.mk文件向NDK编译系统描述你的应用程序需要的原生代码。
nm输出字符 | 含义 |
R | Read only symbol. 比如在代码中有一个const MAXDATA = 3095; 则MAXDATA就是一个Read only symbol |
N | 这是一个调试符号 |
D | 这是一个已经初始化的变量的符号。比如代码中int i = 1和char *str = "Hello"则i和str都是这种类型的符号 |
T | Text段的符号。子程序都是这种符号,比如文件中实现了一个函数function,则function就是这种符号 |
U | 未定义的符号。如果文件中引用了不存在的函数,则这些未定义的函数符号就是这种类型 |
S | 未初始化的符号,比如全局变量int s;则s的符号就是此类型 |
-S 尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,
效果比较明显。隐含了-d参数。
-l 用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用
使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求
编译时使用了-g之类的调试编译选项。
-j name 仅仅显示指定section的信息
同时发现objdump这个指令功能强大,下面是几个我认为常用的option:
objdump -x obj 以某种分类信息的形式把目标文档的数据组织(被分为几大块)输出
objdump -t obj 输出目标文档的符号表
objdump -h obj 输出目标文档的section概括
相关文章推荐
- Javascript的对象操作 - 数组元素操作 【javascript、数组、插入、删除、替换】 ( 咋个办呢 -zgbn)
- Bootstrap
- videojs 视频开发API
- javascript-倒计时-(咋个办呢-zgbn)
- Visual Studio移除Unsed Reference
- Android React Native使用原生模块
- JavaScript获取当前运行脚本文件所在目录的方法
- NSString Class Refernce(Objctive-C)
- 【正完成】Strust2和Bootstrap、mybatis_mysql学习笔记
- CSS:列表项的一些操作
- JavaScript获取对象在页面中位置坐标的方法
- JSP
- jquery点击获取子元素ID值
- Javascript函数声明和函数表达式
- html table边框
- Video of Nanjing receives millions of hits
- js密码强度验证代码
- 基于jQuery实现select下拉选择可输入附源码下载
- AngularJS中页面呈现html代码段
- angularjs绑定树状菜单