无法构建 - 将VC ++代码从VS2010迁移到VS2013

时间:2015-01-12 12:29:25

标签: visual-studio-2010 visual-c++ visual-studio-2013 compiler-errors migration

我正在尝试将我的源码从VS2010迁移到VS2013。它给了我不眠之夜。我收到以下附加的编译错误。请帮我确定哪个编译开关我错过了。我已经从VS2013保存了我的.sln文件,以使其适应新环境。

我目前的编译设置如下: PlatformToolset: Visual Studio 2013 - Windows XP (v120_xp) Command Line: /Yu"stdafx.h" /FR"DebugU\" /GS /TP /analyze- /W3 /Zc:wchar_t /I"..\Common" /Zi /Gm- /Od /Fd".\DebugU/" /fp:precise /D "_PUGIXML" /D "_DEBUG" /D "_USRDLL" /D "_CRT_SECURE_NO_WARNINGS" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_VC80_UPGRADE=0x0700" /D "_USING_V110_SDK71_" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX /Zc:forScope /RTC1 /Gd /Oy- /showIncludes /MTd /Fa".\DebugU/" /EHsc /nologo /Fo".\DebugU/" /Fp".\DebugU/xxxxxxxx.pch"

使用&#34; ShowIncludes&#34;编译日志 1> pugixml.cpp 1> Note: including file: d:\vistasonicpoc\common\pugixml.hpp 1> Note: including file: d:\vistasonicpoc\common\pugiconfig.hpp 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\exception 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\cstddef 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\yvals.h 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xkeycheck.h 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\crtdefs.h 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\use_ansi.h 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\initializer_list 1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421): error C2159: more than one storage class specified 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421) : see reference to class template instantiation 'std::_Has_result_type<_Ty>' being compiled 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421): error C3557: a function cannot have both a return type and a late-specified return type 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(203): error C3557: a function cannot have both a return type and a late-specified return type 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(203): warning C4042: 'std::plus<void>::operator ()' : has bad storage class 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(203): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(218): error C3557: a function cannot have both a return type and a late-specified return type 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(218): warning C4042: 'std::minus<void>::operator ()' : has bad storage class 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(218): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(233): error C3557: a function cannot have both a return type and a late-specified return type 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(233): warning C4042: 'std::multiplies<void>::operator ()' : has bad storage class 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(233): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(248): error C3557: a function cannot have both a return type and a late-specified return type 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(248): warning C4042: 'std::equal_to<void>::operator ()' : has bad storage class 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(248): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(263): error C3557: a function cannot have both a return type and a late-specified return type 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(263): warning C4042: 'std::less<void>::operator ()' : has bad storage class 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(263): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,发现标记/Zc:auto设置为/Zc:auto-,这导致了所有错误。

您似乎没有在命令行中指定它,但它可以帮助其他人具有相同类型的错误。

Zc:auto