windows 知道 .lib 是静态的还是导入的
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6402586/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
know if .lib is static or import
提问by zaharpopov
I have .lib
file compiled from C code. How I know if this self-contained static library or just an import lib and DLL will be needed at runtime? Is there some dumpbin
option I'm missing?
我有.lib
从 C 代码编译的文件。我如何知道在运行时是否需要这个独立的静态库或仅需要导入库和 DLL?有没有dumpbin
我缺少的选项?
回答by bmargulies
Use the lib command. If it's static, lib will show you a pile of .obj files inside. Not so if it's am implib.
使用 lib 命令。如果它是静态的,lib 会向你展示里面的一堆 .obj 文件。如果它是 imlib ,则不是这样。
lib /list foo.lib
will do it.
会做的。
Also see:
另见:
https://docs.microsoft.com/en-us/cpp/build/reference/managing-a-library
https://docs.microsoft.com/en-us/cpp/build/reference/managing-a-library
回答by engf-010
Look in its accompanying header files ,if the function are 'decorated' with __declspec(dllimport)
that it's an import library. Or look for an accompanying .def file ,that also tells you that it's an import library.
查看其随附的头文件,如果该函数被“修饰”为__declspec(dllimport)
一个导入库。或者查找随附的 .def 文件,它也告诉您它是一个导入库。