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?
In Visual StudioIn the left pane, select Configuration Properties, C/C++ and then choose the compiler option category. The topic for each compiler option describes how it can be set and where it is found in the development environment. For more information and a complete list of options, see MSVC compiler options.
Before you start, you should add the -Bv compiler option as an Additional Option on the compiler command line. This will show the verbose compiler version information in the build Output box. Just enter “-Bv” in the Project Properties > C/C++ > Command Line edit box.
Microsoft C++ Compiler (MSVC) This is the default compiler for most Visual Studio C++ projects and is recommended if you are targeting Windows.
The C/C++ compiler in Visual Studio is and always has been Microsoft C++ Compiler, built by Microsoft (not based on anything else.)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With