Archived

This topic is now archived and is closed to further replies.

format of .LIB files?

This topic is 5048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK... I am extremely confused as to what format is used by Microsoft .LIB files (and gcc .a files)... I''ve read all kinds of conflicting things. I tried wotsit''s I tried google I tried msdn The reason I want to know is because I want to convert an import library from the microsoft .lib to a mingw(gcc) .a I know that I can do this with reimp and dlltool but I decided that it would be a good project to see if I could do it myself. I found an old thread on this topic where someone claimed that .lib is COFF format and .a is ELF format... (I don''t believe the ELF part is true because I tried to use the readelf utility on my .a''s .o''s and .exe''s and it couldn''t read any of them) I even found a page on MSDN that said something to the effect of .lib''s being COFF format. However, on Wotsit''s it says that COFF is related to DJGPP (which is true because there is a page on delorie.com claiming to be only reference for COFF) And I couldn''t find any decent info on Wotsit''s concerning the format of .lib''s; I found one file that talks about QBasic libs.. So basically, my question is... what is a reliable way to figure out the formats of files like .lib and .a, and off hand, does anyone know what they are?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you''re interested, try looking for a linker called ''alink'' - this handles win32 libs & objs. It''s open source so you should be able to figure it out from that.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I actually know little something about this, so...
The LIB files and EXEs if I correctly remember are infact COFF. Also .o files are COFF, but there are some differences beetween MS-COFF and gcc COFF files (can''t remember what.)
.a files are actually archives (see ''man ar'' or try ''ar t mylib.a'')
of .o files.
I suggest that you do a ''objdump --all'' on a file. That tell you alot.

Share this post


Link to post
Share on other sites