我在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 ==========
答案 0 :(得分:1)
我也遇到了这个问题。安装vs2012以便能够编译使用vs2012 + XP工具集的解决方案。我收到错误,直到我为VS2012安装了 Update 4 。
答案 1 :(得分:0)
您是否对生成的项目进行了任何更改? 此外,发布的错误列表无法阅读。换行在哪里?
答案 2 :(得分:0)
问题是由于我在我的机器上安装了不同的版本所以sdk路径搞砸了所以我已经格式化了我的电脑并安装了所有版本并且工作正常。