Re: mfc project not compile in visual studio 2008

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I thought it odd that the winnt.h was found in the atlmfc/include subdirectory, since that
is not an expected place to find these header files; they are NOT part of atlmfc, but part
of the platform sdk. I just checked my VS2008 install, and found that it puts the header
files in

c:\program files\Microsoft SDKs\Windows\v6.0A\Include

which is a little odd because it confuses the platform (V6.0A) with the VS (I don't have
6.0 on my new machine). However, I would seriously question why the header file is found
in the place you are finding it.

I looked at line 3019 of my file and it doesn't have anything useful. Are you sure this
header file is in the right place?
joe

On Thu, 10 Apr 2008 07:15:00 -0700, M <M@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I made a mfc project using wizard in visual studio 2008 and it didn`t
compile,. i didn`t add anything, just made it as it should be.
i tried changing _WIN32_WINNT and WINVER 0x0600 but it just resulted in
another errors.
i also reinstalled my vs 2008, but it didn`t help.
For more informations i have win xp sp2 and freshly installed microsoft
visual studio 2008 in a default way.

errors:

1>stdafx.cpp
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winnt.h(3019) : error C2146: syntax error : missing ';'
before identifier 'ContextRecord'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winnt.h(3019) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winnt.h(3019) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winbase.h(1481) : error C2146: syntax error : missing
';' before identifier 'LPCONTEXT'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winbase.h(1481) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winbase.h(1481) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winbase.h(2222) : error C2061: syntax error :
identifier 'LPCONTEXT'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winbase.h(2230) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winbase.h(2230) : error C2143: syntax error : missing
',' before '*'
1>c:\program files\microsoft visual studio 9.0\vc\include\stddef.h(54) :
warning C4005: 'offsetof' : macro redefinition
1> c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\winnt.h(36) : see previous definition of 'offsetof'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(283) : error C2039: 'GlobalAlloc' : is not a
member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(283) : error C2065: 'GMEM_FIXED' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(283) : error C3861: 'GlobalAlloc':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(295) : error C2039: 'GlobalReAlloc' : is not
a member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(295) : error C3861: 'GlobalReAlloc':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(299) : error C2039: 'GlobalFree' : is not a
member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlalloc.h(299) : error C3861: 'GlobalFree': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlconv.h(705) : error C2065:
'wcscpy_instead_use_StringCbCopyW_or_StringCchCopyW' : undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlconv.h(713) : error C2065:
'wcscat_instead_use_StringCbCatW_or_StringCchCatW' : undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcore.h(321) : error C2039: 'FindResourceEx' : is not
a member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcore.h(321) : error C3861: 'FindResourceEx':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcore.h(390) : error C2039: 'FindResourceEx' : is not
a member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcore.h(390) : error C3861: 'FindResourceEx':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcore.h(429) : error C2039: 'SafeArrayGetVartype' :
is not a member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcore.h(429) : error C3861: 'SafeArrayGetVartype':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(212) : error C2039: 'GlobalAlloc' : is not a
member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(212) : error C3861: 'GlobalAlloc': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(216) : error C2039: 'GlobalFree' : is not a
member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(216) : error C3861: 'GlobalFree': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(230) : error C2039: 'GlobalReAlloc' : is not a
member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(230) : error C3861: 'GlobalReAlloc':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(234) : error C2039: 'GlobalSize' : is not a
member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlmem.h(234) : error C3861: 'GlobalSize': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(836) : error C3861: 'VarBstrCat':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1085) : error C2065: 'VARCMP_LT' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1085) : error C3861: 'VarBstrCmp':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1099) : error C2065: 'VARCMP_GT' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1099) : error C3861: 'VarBstrCmp':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1130) : error C2065: 'VARCMP_EQ' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1130) : error C3861: 'VarBstrCmp':
identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1635) : error C2039: 'llVal' : is not a
member of 'tagVARIANT'
1> c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\oaidl.h(399) : see declaration of 'tagVARIANT'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1635) : error C2065: 'llVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1645) : error C2039: 'pllVal' : is not a
member of 'tagVARIANT'
1> c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\oaidl.h(399) : see declaration of 'tagVARIANT'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1645) : error C2065: 'pllVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1655) : error C2039: 'ullVal' : is not a
member of 'tagVARIANT'
1> c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\oaidl.h(399) : see declaration of 'tagVARIANT'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1655) : error C2065: 'ullVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1665) : error C2039: 'pullVal' : is not a
member of 'tagVARIANT'
1> c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\oaidl.h(399) : see declaration of 'tagVARIANT'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1665) : error C2065: 'pullVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1873) : error C2065: 'llVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(1878) : error C2065: 'ullVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2283) : error C2065: 'llVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2295) : error C2065: 'pllVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2306) : error C2065: 'ullVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2318) : error C2065: 'pullVal' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2391) : error C2065: 'VARCMP_EQ' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2391) : error C3861: 'VarCmp': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2403) : error C2065: 'VARCMP_LT' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2403) : error C3861: 'VarCmp': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2410) : error C2065: 'VARCMP_GT' :
undeclared identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\atlcomcli.h(2410) : error C3861: 'VarCmp': identifier
not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\cstringt.h(443) : error C2039:
'GetEnvironmentVariableW' : is not a member of '`global namespace''
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\cstringt.h(443) : error C3861:
'GetEnvironmentVariableW': identifier not found
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\cstringt.h(562) : error C2065:
'vswprintf_instead_use_StringCbVPrintfW_or_StringCchVPrintfW' : undeclared
identifier
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\afxstat_.h(168) : error C2143: syntax error : missing
';' before '*'
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\afxstat_.h(168) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\afxstat_.h(168) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio
9.0\vc\atlmfc\include\afxwin.h(26) : fatal error C1189: #error : Your
version of the Windows SDK is earlier than 6.0. Try setting the 'WINVER' and
'_WIN32_WINNT' definitions in your project to less than 0x0600.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Namespace problems when compiling (xutility)
    ... I am trying to compile my project with MTL (Matrix Template Library) and I am ... undeclared identifier ...
    (microsoft.public.vc.language)
  • memory leak detection
    ... identifier not found, even with argument-dependent lookup ... missing ';' before identifier 'm_abFixedBuffer' ... Node::BYTE': missing storage-class or type specifiers ...
    (microsoft.public.vc.atl)
  • mfc project not compile in visual studio 2008
    ... I made a mfc project using wizard in visual studio 2008 and it didn`t ... before identifier 'ContextRecord' ... a member of '`global namespace'' ... member of 'tagVARIANT' ...
    (microsoft.public.vc.mfc)
  • Windows 2k to Windows XP with VS 7.1
    ... missing ')' before identifier 'hResData'c:\Program Files\Microsoft Visual ... C4229: anachronism used: modifiers on data are ignoredc:\Program ...
    (microsoft.public.vsnet.ide)
  • Re: Help me with these afxv_w32.h errors
    ... C:\Program Files\Microsoft Visual Studio .NET ... missing ';' before 'GetWindowThreadProcessId' ... identifier not found, even with argument-dependent lookup ...
    (microsoft.public.vc.mfc)