Hi

As the title suggests I'm having a problem compiling MFC based applications, this problem started immediately after installing the windows server 2003 platform SDK and now even when I try to compile a new MFC project I get the following errors:

c:\program files\microsoft platform sdk\include\zmouse.h(141) : error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'

    1>c:\program files\microsoft platform sdk\include\zmouse.h(141) : error C2433: 'HWND' : 'inline' not permitted on data declarations

    1>c:\program files\microsoft platform sdk\include\zmouse.h(141) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\program files\microsoft platform sdk\include\zmouse.h(142) : error C2065: 'PUINT' : undeclared identifier

    1>c:\program files\microsoft platform sdk\include\zmouse.h(142) : error C2146: syntax error : missing ')' before identifier 'puiMsh_MsgMouseWheel'

    1>c:\program files\microsoft platform sdk\include\zmouse.h(142) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\program files\microsoft platform sdk\include\zmouse.h(147) : error C2059: syntax error : ')'

    1>c:\program files\microsoft platform sdk\include\zmouse.h(148) : error C2143: syntax error : missing ';' before '{'

    1>c:\program files\microsoft platform sdk\include\zmouse.h(148) : error C2447: '{' : missing function header (old-style formal list?)

    1>c:\program files\microsoft platform sdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT'

    1>c:\program files\microsoft platform sdk\include\commctrl.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\program files\microsoft platform sdk\include\commctrl.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\program files\microsoft platform sdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier

    1>c:\program files\microsoft platform sdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier

    1>c:\program files\microsoft platform sdk\include\prsht.h(97) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\program files\microsoft platform sdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation

in some cases I solved the problem by including windows.h and defining WIN32_LEAN_AND_MEAN at the top of stdafx.h. However for large projects that uses static and dynamic linking to other libraries the proposed solution did not work. I'm not really sure why this is happening as I've also tried to reinstall the platform SDK to no avail.

Any help is appreciated.

Thanx :)

try using this preprocessor definition
_WIN32_WINNT,
WIN32,_WINDOWS,
UNICODE,
_UNICODE

Thanks for the suggestion, WIN32 is already defined in the preprocessor definitions, I have tried your suggestions but I kept getting the same errors.

I also forgot to mention that I've tried to change the order of the C++ include, executable and lib directories.. but I'm still getting the same errors.

Have u given path for library in project setting like C:\Program Files\Microsoft Platform SDK\lib in VC++ directories option ??

make sure u have this setting
Executable Files-
C:\Program Files\Microsoft Platform SDK\bin\winnt
C:\Program Files\Microsoft Platform SDK\bin\

Include Files-
C:\Program Files\Microsoft Platform SDK\include

Library Files-
C:\Program Files\Microsoft Platform SDK\lib

i think prblm sholud not in includes but just check executable and library.

Nothing worked so I uninstalled VS and all related stuff like .netframework, sql serve, etc. Reinstalled everything and now it works fine

This question has already been answered. Start a new discussion instead.