Error LNK2038: A mismatch was found for "_MSC_VER": the value "1600" does not match the value "1700" in CppFile1.obj

I converted my projects from VS2010 to VS2012. But I get a _MSC_VER linker error in some projects. After a long browse through Google, I found that the problem was with binding the library created in VS2010 to VS2012.

How can I find out which project is causing the error? Here I quote the error:

Error 6 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile2.obj) Projectname2 Error 15 error LNK2001: unresolved external symbol "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z) D:\ProjectLocation\Projectname1.lib(CppFile3.obj) Projectname2 Error 13 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile4.obj) Projectname2 Error 12 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile5.obj) Projectname2 Error 10 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile6.obj) Projectname2 Error 11 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile7.obj) Projectname2 Error 9 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile8.obj) Projectname2 Error 4 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile9.obj) Projectname2 Error 14 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile10.obj) Projectname2 Error 7 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile11.obj) Projectname2 Error 8 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile12.obj) Projectname2 Error 5 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:\ProjectLocation\Projectname1.lib(CppFile13.obj) Projectname2 
+60
c ++ visual-c ++ visual-studio-2010 msbuild
Oct 24 '13 at 20:14
source share
4 answers

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

A compiler error indicates objects related to the fact that the information already has the answer you are looking for. In particular, it seems that the static library you are linking should be recompiled.

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

+81
Oct 24 '13 at 20:20
source share

for each project in your solution make sure that

Property> Configuration. Properties> General> Toolkit for the platform

is one for all of them, v100 for visual studio 2010, v110 for visual studio 2012

you can also work with v100 with visual studio 2012

+39
Nov 10 '13 at 13:29
source share

I also imported some projects from VS2010 to VS 2012. I had the same errors. Errors disappeared when I returned Properties> Configuration. Properties> General> Toolbox for the v100 platform (VS2010). However, this may not be the right approach.

+4
Oct 29 '14 at 12:10
source share

I updated from 2010 to 2013 and after changing all the toolkits for the platform, I need to right-click on Solution and select Retarget ... to make it work.

+3
Jun 17 '15 at 6:59
source share



All Articles