列出目标文件中未定义的引用 [英] List undefined references from object file

查看:104
本文介绍了列出目标文件中未定义的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在用g ++构建一堆模块.我用-c打了一些源文件以产生.o目标文件.然后,在某些时候,我使用-r标志对ld组合目标文件,以生成更多.o文件.在此过程中的某个位置,未包含功能.因此,我想做的是找到一个快速工具,该工具可以查看.o文件并告诉您当前未定义哪些引用.

So I'm building a bunch of modules with g++. I hit some of the source files with -c to produce the .o object files. I then at some points combine object files using the -r flag for ld to produce even more .o files. Somewhere in the process, a function is not getting included. So what I'm trying to do is find a quick tool that looks at a .o file and tells what references are currently undefined.

推荐答案

在Linux/Unix上尝试使用nm命令.在输出中,"U"表示未定义符号.

Try the nm command on Linux/Unix. In the output, "U" means the symbol is undefined.

另请参见: nm与objdump之间的差异.

这篇关于列出目标文件中未定义的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆