如何使Visual C ++ 2010中开发的解决方案在Visual C ++ 2012中工作? [英] How do I make a solution developed in Visual C++ 2010 work in Visual C++ 2012?

查看:291
本文介绍了如何使Visual C ++ 2010中开发的解决方案在Visual C ++ 2012中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使Visual C ++ 2010中开发的.cpp解决方案在Visual C ++ 2012中工作,我每次尝试构建时都会遇到以下错误:

How can I make a .cpp solution developed in Visual C++ 2010 work in Visual C++ 2012, I get the error below everytime I try to build,

    1>DinaPhysics-vc10-md-32-d.lib(smPrinter.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smEventGeneratorTrait.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smIntegralType.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smTypes.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec3rBase.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec3r.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec2rBase.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec2r.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec3dBase.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec3d.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec4r.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVecTypes.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smMath.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smUtil.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec4rBase.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec2d.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec2dBase.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>DinaPhysics-vc10-md-32-d.lib(smVec4dBase.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in ShipDeckLandingExample.obj
1>..\..\..\Bin\VC10-32\Debug\ShipDeckLandingExample-vc10-md-32-d.exe : fatal error LNK1319: 18 mismatches detected

提前感谢。

推荐答案

如果Rebuild solution修复它,可能是静态链接到使用以前版本的Visual Studio创建的.lib,并且也使用标准模板库。

If "Rebuild solution" doesn't fix it, it's possible that you are linking statically to a .lib that was created with a previous version of Visual Studio, and that also uses the Standard Template Library.

引用从MSDN此处


•为了实现各种优化和调试检查,C ++标准库实现故意破坏Visual Studio版本(2005,2008,2010,2012)中的二进制兼容性。当使用C ++标准库时,禁止将通过使用不同版本编译的对象文件和静态库混合到一个二进制文件(EXE或DLL)中,并禁止在二进制文件之间传递C ++标准库对象,这些二进制文件通过使用不同版本。将使用Visual C ++ 2010编译的目标文件和静态库(使用C ++标准库)与使用Visual C ++在Visual Studio 2012中编译的目标文件和静态库混合会产生有关_MSC_VER不匹配的链接器错误,其中_MSC_VER是包含编译器的主要版本(Visual Studio 2012中的Visual C ++ 1700)。此检查无法检测DLL混合,并且无法检测涉及Visual C ++ 2008或更早版本的混合。

•To implement various optimizations and debugging checks, the C++ Standard Library implementation intentionally breaks binary compatibility among versions of Visual Studio (2005, 2008, 2010, 2012). When the C++ Standard Library is used, this forbids the mixing of object files and static libraries that are compiled by using different versions into one binary (EXE or DLL), and forbids the passing of C++ Standard Library objects between binaries that are compiled by using different versions. The mixing of object files and static libraries (using the C++ Standard Library) that were compiled by using Visual C++ 2010 with those that were compiled by using Visual C++ in Visual Studio 2012 emits linker errors about _MSC_VER mismatch, where _MSC_VER is the macro that contains the compiler's major version (1700 for Visual C++ in Visual Studio 2012). This check cannot detect DLL mixing, and cannot detect mixing that involves Visual C++ 2008 or earlier.

这篇关于如何使Visual C ++ 2010中开发的解决方案在Visual C ++ 2012中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆