4

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.

sshannin
  • 2,767
  • 1
  • 22
  • 25

2 Answers2

10

On Linux you'd use objdump -t for that. Look for *UND* in its output.

MvG
  • 57,380
  • 22
  • 148
  • 276
7

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

Also see: Difference between nm and objdump.

Community
  • 1
  • 1
olovb
  • 2,164
  • 1
  • 17
  • 20