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).
error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900'
Since you don't have the source code available (and therefore can't retarget libPolyFill
), you're stuck using Visual Studio 2013.
Here's a SO answer with a direct download link to the ISO: https://stackoverflow.com/a/31825881/1741450
C++ / Boost Filesystem - mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600'
libboost_filesystem-vc110-mt-gd-1_51.lib
is a library that has been built with VS 2012 (Also known as VC 11.0), as indicated by the vc110
in the naming convention. This library will not link properly with objects built with VS 2010 (also known as VC 10.0).
If you want to build your program with VS 2010, you'll need to get or build boost libraries for VS 2010.
Error LNK2038 : mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in XX.obj
Though not a perfect solution, I ended up creating a new project and reimporting all dependencies one after another, compiling in between to try and find the issue. After importing all libraries, the new project just worked. I then copied all of my code and compiled it in the new solution, which worked, so the issue has been resolved.
I saved a diff between the two project files, but couldn't find the issue (they are too different for me to make sense out of). Maybe someone with more experience can figure it out.
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).
Related Topics
Detecting If Computer Is Idle Based on Mouse and Keyboard Interactions
Headers Including Each Other in C++
Is a Moved-From Vector Always Empty
Is Adding to a "Char *" Pointer Ub, When It Doesn't Actually Point to a Char Array
When Do We Have to Use Copy Constructors
Extending the C++ Standard Library by Inheritance
Why Can't You Use Offsetof on Non-Pod Structures in C++
One VS2010 Bug ? Allowing Binding Non-Const Reference to Rvalue Without Even a Warning
How to Use If (Pointer) Instead of If (Pointer != Null)
What Is Value of Eof and '\0' in C
Mpirun: Unrecognized Argument Mca
How to Write Log Base(2) in C/C++
Does Vector::Erase() on a Vector of Object Pointers Destroy the Object Itself
C++ Convert from 1 Char to String
Finding the Centroid of a Polygon
Difference Between Pointer and Reference as Thread Parameter
"Undefined Reference To" Using 'G++' to Compile a C++ Program