From: Ramon F Herrera on

I was pleasantly surprised when I uploaded some Windows *.lib files to
my Linux box and discovered that their innards can be scrutinized
with:

% ar t somelibrary.lib

Question 1: IIRC there is a Windows command that performs the same as
the Unix' "ar"? Could you please refresh my memory?

Question 2: The "ar t" command me allows me to see the top level,
which is a bunch of *.obj files. I would like to look deeper, and see
the names of the functions inside those object files. I seem to recall
that there was some command that did this. A Windows and a Unix
version are welcome.

TIA,

-Ramon

From: Jeroen Mostert on
Ramon F Herrera wrote:
> I was pleasantly surprised when I uploaded some Windows *.lib files to
> my Linux box and discovered that their innards can be scrutinized
> with:
>
> % ar t somelibrary.lib
>
Behold an odd little bit of cross-platform compatibility (well, somewhat):
http://en.wikipedia.org/wiki/COFF

> Question 1: IIRC there is a Windows command that performs the same as
> the Unix' "ar"? Could you please refresh my memory?
>
"lib".

> Question 2: The "ar t" command me allows me to see the top level,
> which is a bunch of *.obj files. I would like to look deeper, and see
> the names of the functions inside those object files. I seem to recall
> that there was some command that did this. A Windows and a Unix
> version are welcome.
>
On Windows, use "dumpbin /archivemembers /symbols". On Linux (or Windows,
for that matter, if you have ported binutils), use "nm" or "objdump -t" (the
latter comes closest to dumpbin output, or more likely it's the other way
around).

Note that "nm" (and "objdump" piped through "c++filt") cannot demangle VC++
symbols. I haven't tried whether "dumpbin" can demangle anything *other*
than VC++ symbols, but I doubt it.

--
J.
 | 
Pages: 1
Prev: OxygenatePhP
Next: need help regarding C++ project