error LNK2038: mismatch detected for ‘_MSC_VER’: value ‘1600’ doesn’t match value ‘1700’ in CppFile1.obj

TL;DR; Recompile all your old static-linked .lib files with current-compiler (VS2012, in OP’s case).


You are trying to link objects compiled by different versions of the compiler. That’s not supported in modern versions of VS, at least not if you are using the C++ standard library. Different versions of the standard library are binary incompatible and so you need all the inputs to the linker to be compiled with the same version. Make sure you re-compile all the objects that are to be linked.

The compiler error names the objects involved so the information the the question already has the answer you are looking for. Specifically it seems that the static library that you are linking needs to be re-compiled.

So the solution is to recompile Projectname1.lib with VS2012.

You can link to older .lib files only if:

  • If they are not static-linked, and come with an already compiled .dll file (or .exe file).
  • Or if the two standard-libraries are binary-compatible (which they are not in OP’s case).

Leave a Comment