为什么是这样一个两面三刀性质的LIB文件野兽? [英] Why are LIB files beasts of such a duplicitous nature?

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

问题描述

我试图理解这个LIB文件的企业,在微软Windows和我刚刚提出,会发现 - 我希望 - 消除了迄今有$ P $混乱pvented我获得这个问题明察。要机智,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 显示效用表现为相对或绝对路径)。第三例中,然而,仅包含731引用的DLL。 (我猜 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.)

所以静态库似乎是 .A 在Linux上的文件等同,和DLL似乎映射到的.so 文件。 (顺便说一句,怎么会导入库融入这个在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?)

现在我不知道为什么会这样?为什么Microsoft决定给导入库相同的文件扩展名静态库? (我的理解,从历史上看,静态库是第一个,喜欢的生活preceded更复杂的形式原始的形式。)他们为什么不说,没关系,这里的这些新的库,他们将作为导入库被称为,他们应当承担的文件扩展名 .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天全站免登陆