为什么LIB文件的这种怪兽有这样的二重性? [英] Why are LIB files beasts of such a duplicitous nature?

查看:123
本文介绍了为什么LIB文件的这种怪兽有这样的二重性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Microsoft Windows上了解这个LIB文件业务,而且我刚刚发现了一个发现 - 我希望 - 消除迄今为止阻止我明白把握这个问题的混乱。就是说,LIB文件不是他们的文件扩展名显示的一种文件。

I'm trying to understand this LIB file business on Microsoft Windows, and I've just made a discovery that will - I hope - dispel the confusion that hitherto has prevented me from getting a clear grasp of the issue. To wit, LIB files are not the one kind of file that their file extension suggests they are.

:: cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib"

:: lib /nologo /list Ad1.Lib
obj\i386\activdbgid.obj
obj\i386\activscpid.obj
obj\i386\ad1exid.obj
obj\i386\dbgpropid.obj
obj\i386\dispexid.obj

:: lib /nologo /list oledb.lib
o:\winmain.obj.x86fre\enduser\…\oledb\uuid\objfre\i386\oledbiid.obj
o:\winmain.obj.x86fre\enduser\…\oledb\uuid\objfre\i386\oledbnewiid.obj
o:\winmain.obj.x86fre\enduser\…\oledb\uuid\objfre\i386\cmdtreeiid.obj
o:\winmain.obj.x86fre\enduser\…\oledb\uuid\objfre\i386\oledbdepiid.obj

:: lib /nologo /list AdvAPI32.Lib | sort | uniq -c
    731 ADVAPI32.dll

前两个示例包含对象文件通过 lib.exe 实用程序显示时的相对路径或绝对路径)。但是,第三个示例仅包含对该DLL的731个引用。 (我猜 lib.exe 不是为了显示这种文件的更有用的信息。)

The first two examples contain object files (appearing as relative or absolute paths when displayed by the lib.exe utility). The third example, however, only contains 731 references to a DLL. (I guess lib.exe isn't designed to display more useful information for this kind of file.)

一些包含对象文件,它们是静态库。其他的包含符号,它们是导入库。 (这里有一个简短解释)。)

Some contain object files, and they are static libraries. Others contain symbols, and they are import libraries. (There's a short explanation here.)

所以静态库似乎是Linux上的 .a 文件的等价物,DLL似乎映射到 .so 文件Linux操作系统。 (顺便说一下,如何导入图书馆适合这个Windows / Linux等效图片?)

So static libraries appear to be the equivalents of .a files on Linux, and DLLs appear to map to .so files on Linux. (By the way, how would import libraries fit into this Windows/Linux equivalence picture?)

现在我想知道为什么这样吗?为什么微软决定给导入库与静态库相同的文件扩展名? (我知道历史上,静态图书馆首先是像原始形式的生活先于更复杂的形式)。为什么他们不说这些新的图书馆,他们将被称为进口图书馆,承担文件扩展名 .ILB (或其他)?

Now I'm wondering why this is so? Why did Microsoft decide to give import libraries the same file extension as static libraries? (I understand that historically, static libraries were first, like primitive forms of life preceded more complex forms.) Why wouldn't they say, okay, here's these new kind of libraries, they shall be referred to as import libraries, and they shall bear the file extension .ILB (or whatever)?

推荐答案

因为他们库。为什么要发明一个全新的特定于供应商的扩展,与之前的供应商特定的库完全相同?

Because they are libraries. Why invent a whole new vendor-specific extension for what is exactly the same thing as their already-vendor-specific libraries?

这篇关于为什么LIB文件的这种怪兽有这样的二重性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆