error LNK2038: mismatch detected for #39;_MSC_VER#39;: value #39;1600#39; doesn#39;t match value #39;1700#39; in CppFile1.obj(错误 LNK2038:检测到“_MSC_VER不匹配:值“1600与 CppFile1.obj 中的值“1700不匹配)
问题描述
我正在将我的项目从 VS2010 转换为 VS2012.但是我在某些项目中遇到了 _MSC_VER 链接器错误.通过谷歌长时间浏览后,我发现问题是由于将在 VS2010 中创建的库链接到 VS2012.
I was converting my projects from VS2010 to VS2012.But I am getting an _MSC_VER linker error in certain projects. After a long surfing through google I found out that the issue is due to linking of a library created in VS2010 to VS2012.
如何找出导致错误的项目?我在这里引用错误:
How can I find out that which projectis causing the error? Here I am quoting the error:
Error 6 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.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_Registerlocale@CAXPAV123@@Z) D:ProjectLocationProjectname1.lib(CppFile3.obj) Projectname2
Error 13 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile4.obj) Projectname2
Error 12 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile5.obj) Projectname2
Error 10 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile6.obj) Projectname2
Error 11 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile7.obj) Projectname2
Error 9 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile8.obj) Projectname2
Error 4 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile9.obj) Projectname2
Error 14 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile10.obj) Projectname2
Error 7 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile11.obj) Projectname2
Error 8 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile12.obj) Projectname2
Error 5 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj D:ProjectLocationProjectname1.lib(CppFile13.obj) Projectname2
推荐答案
您正在尝试链接由不同版本的编译器编译的对象.这在现代版本的 VS 中不受支持,至少在您使用 C++ 标准库时不支持.标准库的不同版本是二进制不兼容的,因此您需要使用相同版本编译链接器的所有输入.确保重新编译所有要链接的对象.
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.
所以解决办法是用VS2012重新编译Projectname1.lib.
So the solution is to recompile Projectname1.lib with VS2012.
这篇关于错误 LNK2038:检测到“_MSC_VER"不匹配:值“1600"与 CppFile1.obj 中的值“1700"不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 LNK2038:检测到“_MSC_VER"不匹配:值“1600
基础教程推荐
- Windows Media Foundation 录制音频 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01