views:

456

answers:

1

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?

+1  A: 

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

For debug libraries, you can use dumpbin:

dumpbin /rawdata:1 library.lib

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.

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.

James McNellis