有没有办法确定使用哪个版本的Visual Studio编译静态库?

有没有办法确定使用哪个版本的Visual Studio编译静态库?

问题描述:

我有一组静态库(.lib)文件,其中的一个可能是使用其他版本的Visual Studio构建的.这导致链接到所有项目的项目的代码生成失败.有什么方法可以确定使用哪个版本的Visual Studio编译静态库?

I have a collection of static libraries (.lib) files one of which may have been built with a different version of Visual Studio. This is causing the code generation of a project that links against all of them to fail. Is there any way to determine which version of Visual Studio was used to compile a static library?

对于发布库,不太可能确定版本.

For release libraries, it's unlikely that you could determine the version.

对于调试库,可以使用垃圾箱:

For debug libraries, you can use dumpbin:

dumpbin /rawdata:1 library.lib

程序集清单应位于转储的开始,并将包含库所需的CRT版本以及用于构建库的编译器的完整路径.

The assembly manifest should be at the beginning of the dump and will contain the version of the CRT the library requires along with the full path to the compiler used to build the library.

对于可执行文件和DLL,您可以使用dumpbin获取链接器版本.它在可选标题值"下

For executables and DLLs you can get the linker version using dumpbin; it's under "OPTIONAL HEADER VALUES"

dumpbin /headers program.exe

也许其他人知道获取发布库版本的方法;我当然也很感兴趣.

Maybe someone else knows of a way to get the version for release libraries; I'm certainly interested too if they are.