天天看点

检测到“_MSC_VER”的不匹配项: 值“1600”不匹配值“1900”

项目编译报错,vs版本不兼容

两种解决办法:

1.右键项目,属性,常规中将平台工具集更改为vs2010版本

2.项目中附加的.lib之前用vs2010编译,不能在vs2017中使用,需要重新编译该.lib文件

将生成.lib的项目升级到vs2017,重新编译后生成.lib,并替换到当前项目

另附不兼容原因:https://stackoverflow.com/questions/19575747/error-lnk2038-mismatch-detected-for-msc-ver-value-1600-doesnt-match-valu

down vote accepted

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.