-1

我在 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.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 ==========
4

3 回答 3

1

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

于 2014-09-26T11:24:52.647 回答
0

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

于 2013-01-02T17:13:03.630 回答
0

问题是由于我在我的机器上安装了不同的版本,所以 sdk 路径搞砸了,所以我格式化了我的电脑并安装了所有版本并且工作正常。

于 2013-04-17T08:01:26.527 回答