免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3308 | 回复: 4
打印 上一主题 下一主题

如何定位GCC链接时找不到的符号 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-03 15:58 |只看该作者 |倒序浏览
GCC在链接程序时,有些符号找不到,输出如下信息:
22 utils.c.text+0x1b6c): undefined reference to `dsputil_static_init'
23 utils.c.text+0x1b7d): undefined reference to `av_crc04C11DB7'
24 utils.c.text+0x1b8e): undefined reference to `av_crc8005'
25 utils.c.text+0x1b9f): undefined reference to `av_crc07'
26 utils.c.text+0x1bc4): undefined reference to `av_crc04C11DB7'
27 utils.c.text+0x1bcc): undefined reference to `av_crc_init'
28 utils.c.text+0x1bf1): undefined reference to `av_crc8005'
29 utils.c.text+0x1bf9): undefined reference to `av_crc_init'
30 utils.c.text+0x1c1e): undefined reference to `av_crc07'
31 utils.c.text+0x1c26): undefined reference to `av_crc_init'

有些符号是通过宏定义的,在utils.c中找不到。用什么方法可以定位到这些符号?
utils.c:(.text+0x1b6c):表示utils.o代码段0x1b6c的位置吗?

论坛徽章:
0
2 [报告]
发表于 2009-03-03 16:01 |只看该作者
呵呵,真有意思,自动解析成图标了,不过这些图标还真表示了我当前的心情

GCC在链接程序时,有些符号找不到,输出如下信息:
22 utils.c: (.text+0x1b6c): undefined reference to `dsputil_static_init'
23 utils.c: (.text+0x1b7d): undefined reference to `av_crc04C11DB7'
24 utils.c: (.text+0x1b8e): undefined reference to `av_crc8005'
25 utils.c: (.text+0x1b9f): undefined reference to `av_crc07'
26 utils.c: (.text+0x1bc4): undefined reference to `av_crc04C11DB7'
27 utils.c: (.text+0x1bcc): undefined reference to `av_crc_init'
28 utils.c: (.text+0x1bf1): undefined reference to `av_crc8005'
29 utils.c: (.text+0x1bf9): undefined reference to `av_crc_init'
30 utils.c: (.text+0x1c1e): undefined reference to `av_crc07'
31 utils.c: (.text+0x1c26): undefined reference to `av_crc_init'

有些符号是通过宏定义的,在utils.c中找不到。用什么方法可以定位到这些符号?
utils.c: (.text+0x1b6c):表示utils.o代码段0x1b6c的位置吗?

[ 本帖最后由 painkiller0513 于 2009-3-3 16:02 编辑 ]

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
3 [报告]
发表于 2009-03-03 16:12 |只看该作者
grep 搜索一下,看看有没有定义这几个函数

论坛徽章:
0
4 [报告]
发表于 2009-03-03 23:34 |只看该作者
我一般都是在souce insight中直接搜索的

论坛徽章:
0
5 [报告]
发表于 2009-03-03 23:34 |只看该作者
可以使用ldd看一下,看看这个模块依赖哪些库
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP