Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
859 views
in Technique[技术] by (71.8m points)

visual studio - Which format does static library (*.lib) files use? Where can I find "Official" specifications of *.LIB file structure/format?

Just now I found that static libraries in *nix systems, in other words *.a libraries are nothing but archives of relocatables(*.o files) in ar fromat.

  1. What about static libraries(*.lib files) in windows? Which format are they in?

  2. I found an article (archived copy 1, archived copy 2) which explains *.lib file structure. But Where can I find "Official" specifications of *.lib file structure/format?

  3. Other than ar.exe of mingw is there any tool from Microsoft which extracts relocatable objects of *.lib & *.a files?

EDIT:

I wonder why I'm unable to get to this question. If there are no official specifications. Then how does the compiler ('linker' to be more correct) writers work with *.LIB files?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I found that *.LIB file uses the ar file format.

Official Specifications: Section 7. "Archive (Library) File Format" of Microsoft Portable Executable and Common Object File Format Specification describes this format.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...