tags:

views:

82

answers:

3

Hi, How can I view symbols in a .o file? nm does not work for me. I use g++/linux.

+1  A: 

There is a command to take a look at which functions are included in an object file or library or executable:

nm
Als
+1  A: 

Instead of nm, you can use the powerful objdump. See the man page for details. Try objdump -t myfile or objdump -T myfile. With the -C flag you can also demangle C++ names, like nm does.

DarkDust
I tried ObjDump also. Same result : `objdump: Lib1.o: File format not recognized`
nakiya
A: 

Have you been using a cross-compiler for another platform? If so, you need to use the respective nm or objdump commmand.

For example, if you have used XXX-YYY-gcc to compile the .o file, you need to use XXX-YYY-nm or XXX-YYY-objdump to process the files.

Schedler