Visual c++ 基于对话框的应用程序不在VS 2012中编译

Visual c++ 基于对话框的应用程序不在VS 2012中编译,visual-c++,mfc,Visual C++,Mfc,我已经在Windows7机器上安装了VS2012,并创建了一个干净的基于对话框的MFC应用程序。编译它会产生以下错误: 1>------ Build started: Project: MFCApplication1, Configuration: Debug Win32 ------ 1> stdafx.cpp 1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcore.h(

我已经在Windows7机器上安装了VS2012,并创建了一个干净的基于对话框的MFC应用程序。编译它会产生以下错误:

1>------ Build started: Project: MFCApplication1, Configuration: Debug Win32 ------
1>  stdafx.cpp
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcore.h(633): error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3011): error C2061: syntax error : identifier '__RPC__inout_xcount'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3011): error C2733: 'BSTR_UserMarshal' : second C linkage of overloaded function not allowed
1>          c:\program files\microsoft sdks\windows\v6.0a\include\oaidl.h(5126) : see declaration of 'BSTR_UserMarshal'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3012): error C2061: syntax error : identifier '__RPC__in_xcount'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3012): error C2733: 'BSTR_UserUnmarshal' : second C linkage of overloaded function not allowed
1>          c:\program files\microsoft sdks\windows\v6.0a\include\oaidl.h(5127) : see declaration of 'BSTR_UserUnmarshal'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3016): error C2061: syntax error : identifier '__RPC__inout_xcount'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3016): error C2733: 'HWND_UserMarshal' : second C linkage of overloaded function not allowed
1>          c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3697) : see declaration of 'HWND_UserMarshal'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3017): error C2061: syntax error : identifier '__RPC__in_xcount'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atliface.h(3017): error C2733: 'HWND_UserUnmarshal' : second C linkage of overloaded function not allowed
1>          c:\program files\microsoft sdks\windows\v6.0a\include\oleidl.h(3698) : see declaration of 'HWND_UserUnmarshal'
1>c:\program files (x86)\windows kits\8.0\include\um\uianimation.h(2621): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxanimationhelper.h(411): error C2065: 'UI_E_VALUE_NOT_SET' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxanimationhelper.h(441): error C2065: 'UI_E_VALUE_NOT_SET' : undeclared identifier
1>c:\program files\microsoft sdks\windows\v6.0a\include\dxgitype.h(85): error C2011: 'DXGI_FORMAT' : 'enum' type redefinition
1>          c:\program files (x86)\windows kits\8.0\include\um\dxgiformat.h(11) : see declaration of 'DXGI_FORMAT'
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(309): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(707): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(853): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(923): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(1007): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(1036): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\d2d1.h(1092): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxwin.h(5584): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxwin.h(5584): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxwin.h(5584): warning C4183: 'GetITaskbarList3': missing return type; assumed to be a member function returning 'int'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxglobals.h(317): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxglobals.h(317): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxglobals.h(317): warning C4183: 'GetITaskbarList3': missing return type; assumed to be a member function returning 'int'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

您是否对生成的项目进行了任何更改?
此外,你发布的错误列表是无法阅读的。换行符在哪里?

问题是由于我在我的机器上安装了不同的版本,因此sdk路径混乱,因此我已格式化我的计算机并安装了所有版本,工作正常。

我也遇到了问题。已安装vs2012,以便能够编译使用vs2012+XP工具集的解决方案。在为VS2012安装更新4之前,我一直遇到这个错误。

示例代码会很有帮助。我刚刚创建并运行了dialog base应用程序,代码没有任何更改。请编辑您的问题,使错误消息可读。没有,我在project中没有做任何更改。