visual c++ -基于对话框的应用程序无法在VS 2012中编译



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

1>------ Build started: Project: MFCApplication1, Configuration: Debug Win32 ------
1>  stdafx.cpp
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatlcore.h(633): error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3011): error C2061: syntax error : identifier '__RPC__inout_xcount'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3011): error C2733: 'BSTR_UserMarshal' : second C linkage of overloaded function not allowed
1>          c:program filesmicrosoft sdkswindowsv6.0aincludeoaidl.h(5126) : see declaration of 'BSTR_UserMarshal'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3012): error C2061: syntax error : identifier '__RPC__in_xcount'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3012): error C2733: 'BSTR_UserUnmarshal' : second C linkage of overloaded function not allowed
1>          c:program filesmicrosoft sdkswindowsv6.0aincludeoaidl.h(5127) : see declaration of 'BSTR_UserUnmarshal'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3016): error C2061: syntax error : identifier '__RPC__inout_xcount'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3016): error C2733: 'HWND_UserMarshal' : second C linkage of overloaded function not allowed
1>          c:program filesmicrosoft sdkswindowsv6.0aincludeoleidl.h(3697) : see declaration of 'HWND_UserMarshal'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3017): error C2061: syntax error : identifier '__RPC__in_xcount'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeatliface.h(3017): error C2733: 'HWND_UserUnmarshal' : second C linkage of overloaded function not allowed
1>          c:program filesmicrosoft sdkswindowsv6.0aincludeoleidl.h(3698) : see declaration of 'HWND_UserUnmarshal'
1>c:program files (x86)windows kits8.0includeumuianimation.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.0vcatlmfcincludeafxanimationhelper.h(411): error C2065: 'UI_E_VALUE_NOT_SET' : undeclared identifier
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeafxanimationhelper.h(441): error C2065: 'UI_E_VALUE_NOT_SET' : undeclared identifier
1>c:program filesmicrosoft sdkswindowsv6.0aincludedxgitype.h(85): error C2011: 'DXGI_FORMAT' : 'enum' type redefinition
1>          c:program files (x86)windows kits8.0includeumdxgiformat.h(11) : see declaration of 'DXGI_FORMAT'
1>c:program files (x86)windows kits8.0includeumd2d1.h(309): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)windows kits8.0includeumd2d1.h(707): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)windows kits8.0includeumd2d1.h(853): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)windows kits8.0includeumd2d1.h(923): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)windows kits8.0includeumd2d1.h(1007): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)windows kits8.0includeumd2d1.h(1036): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)windows kits8.0includeumd2d1.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.0vcatlmfcincludeafxwin.h(5584): error C2143: syntax error : missing ';' before '*'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeafxwin.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.0vcatlmfcincludeafxwin.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.0vcatlmfcincludeafxglobals.h(317): error C2143: syntax error : missing ';' before '*'
1>c:program files (x86)microsoft visual studio 11.0vcatlmfcincludeafxglobals.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.0vcatlmfcincludeafxglobals.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 ==========

我也有这个问题。安装vs2012后能够进行编译的解决方案,使用vs2012 + XP工具集。我得到了错误,直到我安装了更新4 VS2012。

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

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

相关内容

  • 没有找到相关文章

最新更新