0

Is there any possibility to see what .a file content(types,methods etc.) is in Eclipse? I have .a library and documentation about methods,but when i try to use these methods in program, Eclipse says that there is no such methods... I want to know which methods .a contains in order to work with this library.

Geka P
  • 587
  • 1
  • 6
  • 22

2 Answers2

1

Yes and no. Some of the information is in the .a binary (like exported function, global and class names), and depending on what programming language the file was written in, and how much it was optimized, even more (e.g. you could theoretically tell from the name of a C++ method what parameters it takes).

And if you're good with assembler, you could dis-assemble the .a and find out how the code actually works and from that deduce what parameters it takes.

But in practice, without doing all that work? No. You need the .h header files that came with the library to find out what parameters a method takes, how large structs are and what fields they're made up of, etc.

uliwitness
  • 8,532
  • 36
  • 58
1

You can use the utility nm or its Window analog dumpbin to read the function names from a library (see details here: Microsoft equivalent of the nm command).

If library is in C, you will not get more than names. If it is in C++ or Java, the parameters' types (but not the return type) are "mangled" into the name. On Unix you can demangle them use the program c++filt. There are also online services which demangle both GCC and MSFT function names for C/C++ and Java: Is there an online name demangler for C++?

Community
  • 1
  • 1
Michael Simbirsky
  • 3,045
  • 1
  • 12
  • 24