1

我正在尝试在 Visual Studio 2010 Professional 中创建 C++ 项目。我选择了包含 ATL 和 MFC 文件的 Windows 控制台项目。当我尝试构建项目时,会生成大量错误。如何解决问题?

我在 64 位机器上使用 Windows 7,VS 2010 Professional。

1>------ Build started: Project: test, Configuration: Debug Win32 ------
1>Build started 16.02.2013 16:33:55.
1>InitializeBuildStatus:
1>  Touching "Debug\test.unsuccessfulbuild".
1>ClCompile:
1>  stdafx.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(697): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(697): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(709): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(709): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(718): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(718): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(730): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(730): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(746): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(746): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(756): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(756): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(767): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(767): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(779): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(779): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(795): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(795): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1219): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1219): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1228): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1228): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1334): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1334): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1347): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1347): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1355): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1355): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1363): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1363): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1387): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1387): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1556): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1556): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1556): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1556): error C3861: 'AtlGetStringResourceImage': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1557): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1559): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1559): error C2227: left of '->achString' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1559): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1559): error C2227: left of '->nLength' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1576): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1576): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1576): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1576): error C3861: 'AtlGetStringResourceImage': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1577): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1579): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1579): error C2227: left of '->achString' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1579): error C2065: 'pImage' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(1579): error C2227: left of '->nLength' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2142): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2142): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2170): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2170): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2193): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2193): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2260): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2260): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2277): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2277): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2286): error C2039: 'AtlSafeArrayGetActualVartype' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2286): error C3861: 'AtlSafeArrayGetActualVartype': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2297): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2297): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2301): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2301): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2338): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2338): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2357): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2357): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2377): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2377): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2701): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2701): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2710): error C2039: 'AtlSafeArrayGetActualVartype' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2710): error C3861: 'AtlSafeArrayGetActualVartype': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2721): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2721): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2725): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2725): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2904): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2904): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2919): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2919): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2933): error C2039: 'AtlThrowImpl' : is not a member of 'ATL'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2933): error C3861: 'AtlThrowImpl': identifier not found
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(343): error C2146: syntax error : missing ';' before identifier 'AutoCriticalSection'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(343): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(343): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(360): error C2146: syntax error : missing ';' before identifier 'AutoCriticalSection'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(360): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(360): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(361): error C2146: syntax error : missing ';' before identifier 'AutoDeleteCriticalSection'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(361): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(361): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(362): error C2146: syntax error : missing ';' before identifier 'CriticalSection'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(362): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(362): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(377): error C2146: syntax error : missing ';' before identifier 'AutoCriticalSection'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(377): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(377): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(425): error C2146: syntax error : missing ';' before identifier 'm_csObjMap'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(425): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(425): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(434): error C2146: syntax error : missing ';' before identifier 'm_csWindowCreate'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(434): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(434): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(446): error C2146: syntax error : missing ';' before identifier 'm_csStaticDataInitAndTypeInfo'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(446): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(446): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2375): error C2065: 'm_csObjMap' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2375): error C2228: left of '.Init' must have class/struct/union
1>          type is ''unknown-type''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2379): error C2653: 'CAtlBaseModule' : is not a class or namespace name
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2379): error C2065: 'm_bInitFailed' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2407): error C2065: 'm_csObjMap' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2407): error C2228: left of '.Term' must have class/struct/union
1>          type is ''unknown-type''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2712): error C2653: 'CAtlBaseModule' : is not a class or namespace name
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2712): error C2065: 'm_bInitFailed' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2725): error C2065: '_AtlBaseModule' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlbase.h(2725): fatal error C1003: error count exceeds 100; stopping compilation
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.73
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
4

0 回答 0