Is there a command in Linux to find out if a library was built in 32 or 64-bit mode

gcc 4.5.1 Fedora 14 Linux 

I have this static library that was built by a previous programmer. However, he left the company, and we do not have the source code. All we have is the *.h header files and the libnet.a static library.

When I try to associate this with our application. I get incompatible linker error . I think the problem is that the static library was built on a 32-bit machine. And I'm trying to tie up using a 64 bit machine. I could compile my application using cflag -m32. However, I just want to know if there is any command that will give me if the static library was built in 32 or 64-bit mode?

Thanks so much for any suggestions,

+7
source share
3 answers

An .a archive is just a collection of objects, so why not:

 ar x libnet.a file someobj.o 

This will give you an answer like:

 someobj.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped 
+8
source

Just running file over it might be enough?

+7
source

opening it in a hex editor with the form ascii may reveal some clues

0
source

All Articles