Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to determine which version of Visual Studio was used to compile a static library?

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?

like image 601
Bill Carey Avatar asked Sep 11 '09 16:09

Bill Carey


People also ask

How do I know my Visual Studio compiler?

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.

How do I know my compiler version in Visual Studio 2019?

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.

What compiler does Visual Studio 2019 use?

Microsoft C++ Compiler (MSVC) This is the default compiler for most Visual Studio C++ projects and is recommended if you are targeting Windows.

What compiler does Microsoft Visual Studio use?

The C/C++ compiler in Visual Studio is and always has been Microsoft C++ Compiler, built by Microsoft (not based on anything else.)


1 Answers

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.

like image 180
James McNellis Avatar answered Sep 17 '22 13:09

James McNellis