I am trying to compile a program with the VS .NET 2005 Beta 2 command-line C++ compiler (cl.exe). The program uses MFC header files from the latest Microsoft Platform SDK. The compiler successfully includes all the correct headers, but returns the following error messages:
C:\Program Files\Microsoft Platform SDK\Include\mfc\afxwin1.inl(1034) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft Platform SDK\Include\mfc\afxwin1.inl(1036) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I checked the lines of code mentioned and found the following:
1033 _AFXWIN_INLINE CMenu::operator==(const CMenu& menu) const
1034 { return ((HMENU) menu) == m_hMenu; }
1035 _AFXWIN_INLINE CMenu::operator!=(const CMenu& menu) const
1036 { return ((HMENU) menu) != m_hMenu; }
Does anybody know of a resolution to this problem

Error C4430: missing type specifier
woef22
#ifndef
VOID#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
#endif
So the only way I can see that you could be hitting this problem is if somehow your program (or some header file you are #include'ing) is defining LONG to be a macro.
Khushal
In both cases, line 8806 of winnt.h and line 2722 of winbase.h, the macro LONG is undefined by the time the preprocessor gets there, so the compiler doesn't know what to typedef something to:
typedef LONG (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
struct _EXCEPTION_POINTERS *ExceptionInfo
);
is preprocessed into
typedef (__stdcall *PVECTORED_EXCEPTION_HANDLER)(
struct _EXCEPTION_POINTERS *ExceptionInfo
);
and
typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
__in struct _EXCEPTION_POINTERS *ExceptionInfo
);
is preprocessed into
typedef (__stdcall *PTOP_LEVEL_EXCEPTION_FILTER)(
struct _EXCEPTION_POINTERS *ExceptionInfo
);
Help, please!
BullZhot aka Klaes
Which version of the PSDK are you using The most recent version should have all these problems fixed as we did make a pass through them with the latest compiler.
microspectrum
1033 _AFXWIN_INLINE bool CMenu::operator==(const CMenu& menu) const
1034 { return ((HMENU) menu) == m_hMenu; }
1035 _AFXWIN_INLINE bool CMenu::operator!=(const CMenu& menu) const
1036 { return ((HMENU) menu) != m_hMenu; }
AndrewJones
This code built fine with VC++ 2003 .NET, but that has its own SDK subset and doesn't use the main Platform SDK. Visual C++ Express beta didn't come with the full SDK, so I had to download that and that's when the problem started.
Anyway, this is clearly not a Microsoft issue, so thanks for your help.