Hi, I'm using Microsoft Visual C++ 2005 Standard, I recently downloaded
the latest version of WTL, and used it's AppWiz to create a simple
application. Upon compiling, however, I'm met with nearly 200 errors,
most of which look something like this:

c:\program files\microsoft visual studio
8\vc\platformsdk\include\winbase.h(226) : error C2146: syntax error :
missing ';' before identifier 'Internal'

c:\program files\microsoft visual studio
8\vc\platformsdk\include\winbase.h(226) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int

c:\program files\microsoft visual studio
8\vc\platformsdk\include\winbase.h(227) : error C2146: syntax error :
missing ';' before identifier 'InternalHigh'

c:\program files\microsoft visual studio
8\vc\platformsdk\include\winbase.h(295) : error C2146: syntax error :
missing ';' before identifier 'CRITICAL_SECTION'

c:\program files\microsoft platform sdk\include\winbase.h(307) : error
C2146: syntax error : missing ';' before identifier 'PVOID'

c:\program files\microsoft platform sdk\include\winbase.h(315) : error
C2086: 'int DECLSPEC_IMPORT' : redefinition

c:\program files\microsoft platform sdk\include\winbase.h(2031) : error
C2146: syntax error : missing ';' before identifier 'ullTotalPhys'

And so on and so forth. Incidently, these errors also occur when I try
to compile other applications and frameworks dependent on the PSDK,
such as wxWidgets. I've already tried downloading a fresh SDK and point
VC++ towards it.

Can anyone help me figure out what's wrong here?
Thanks.

Re: WTL and winbase.h by Alex

Alex
Fri Sep 22 03:05:35 CDT 2006

<foahchon@hotmail.com> wrote:
> Hi, I'm using Microsoft Visual C++ 2005 Standard, I
> recently downloaded
> the latest version of WTL, and used it's AppWiz to create
> a simple
> application. Upon compiling, however, I'm met with nearly
> 200 errors,
> most of which look something like this:
>
> c:\program files\microsoft visual studio
> 8\vc\platformsdk\include\winbase.h(226) : error C2146:
> syntax error :
> missing ';' before identifier 'Internal'
>
> c:\program files\microsoft visual studio
> 8\vc\platformsdk\include\winbase.h(226) : error C4430:
> missing type
> specifier - int assumed. Note: C++ does not support
> default-int
>
> c:\program files\microsoft visual studio
> 8\vc\platformsdk\include\winbase.h(227) : error C2146:
> syntax error :
> missing ';' before identifier 'InternalHigh'
>
> c:\program files\microsoft visual studio
> 8\vc\platformsdk\include\winbase.h(295) : error C2146:
> syntax error :
> missing ';' before identifier 'CRITICAL_SECTION'
>
> c:\program files\microsoft platform
> sdk\include\winbase.h(307) : error
> C2146: syntax error : missing ';' before identifier
> 'PVOID'
>
> c:\program files\microsoft platform
> sdk\include\winbase.h(315) : error
> C2086: 'int DECLSPEC_IMPORT' : redefinition
>
> c:\program files\microsoft platform
> sdk\include\winbase.h(2031) : error
> C2146: syntax error : missing ';' before identifier
> 'ullTotalPhys'
>
> And so on and so forth. Incidently, these errors also
> occur when I try
> to compile other applications and frameworks dependent on
> the PSDK,
> such as wxWidgets. I've already tried downloading a fresh
> SDK and point
> VC++ towards it.


Did you #include <windows.h> before including other headers?



Re: WTL and winbase.h by foahchon

foahchon
Fri Sep 22 12:30:31 CDT 2006

Thanks for your reply. I didn't include anything; the project was
generated by a script. I would have to assume that the generator got
the #include order right. The same can be said about the wxWidgets
framework package.

Alex Blekhman wrote:
> <foahchon@hotmail.com> wrote:
> > Hi, I'm using Microsoft Visual C++ 2005 Standard, I
> > recently downloaded
> > the latest version of WTL, and used it's AppWiz to create
> > a simple
> > application. Upon compiling, however, I'm met with nearly
> > 200 errors,
> > most of which look something like this:
> >
> > c:\program files\microsoft visual studio
> > 8\vc\platformsdk\include\winbase.h(226) : error C2146:
> > syntax error :
> > missing ';' before identifier 'Internal'
> >
> > c:\program files\microsoft visual studio
> > 8\vc\platformsdk\include\winbase.h(226) : error C4430:
> > missing type
> > specifier - int assumed. Note: C++ does not support
> > default-int
> >
> > c:\program files\microsoft visual studio
> > 8\vc\platformsdk\include\winbase.h(227) : error C2146:
> > syntax error :
> > missing ';' before identifier 'InternalHigh'
> >
> > c:\program files\microsoft visual studio
> > 8\vc\platformsdk\include\winbase.h(295) : error C2146:
> > syntax error :
> > missing ';' before identifier 'CRITICAL_SECTION'
> >
> > c:\program files\microsoft platform
> > sdk\include\winbase.h(307) : error
> > C2146: syntax error : missing ';' before identifier
> > 'PVOID'
> >
> > c:\program files\microsoft platform
> > sdk\include\winbase.h(315) : error
> > C2086: 'int DECLSPEC_IMPORT' : redefinition
> >
> > c:\program files\microsoft platform
> > sdk\include\winbase.h(2031) : error
> > C2146: syntax error : missing ';' before identifier
> > 'ullTotalPhys'
> >
> > And so on and so forth. Incidently, these errors also
> > occur when I try
> > to compile other applications and frameworks dependent on
> > the PSDK,
> > such as wxWidgets. I've already tried downloading a fresh
> > SDK and point
> > VC++ towards it.
>
>
> Did you #include <windows.h> before including other headers?


Re: WTL and winbase.h by Tim

Tim
Sat Sep 23 00:16:02 CDT 2006

foahchon@hotmail.com wrote:
>
>Hi, I'm using Microsoft Visual C++ 2005 Standard, I recently downloaded
>the latest version of WTL, and used it's AppWiz to create a simple
>application. Upon compiling, however, I'm met with nearly 200 errors,
>most of which look something like this:
>
>c:\program files\microsoft visual studio
>8\vc\platformsdk\include\winbase.h(226) : error C2146: syntax error :
>missing ';' before identifier 'Internal'

This is missing ULONG_PTR, which is defined in <basetsd.h>, which is called
from <winnt.h> which is called from <windef.h>, which is called from
<windows.h>.

>c:\program files\microsoft visual studio
>8\vc\platformsdk\include\winbase.h(295) : error C2146: syntax error :
>missing ';' before identifier 'CRITICAL_SECTION'

This is missing RTL_CRITICAL_SECTION, which is defined in <winnt.h>

Is is possible that you have your own include file called winnt.h or
windef.h in the include path that is interfering?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: WTL and winbase.h by Alex

Alex
Sat Sep 23 03:59:10 CDT 2006

"foahchon" wrote:
> Thanks for your reply. I didn't include anything; the
> project was
> generated by a script. I would have to assume that the
> generator got
> the #include order right. The same can be said about the
> wxWidgets
> framework package.


I never used wxWidgets myself, however it may be possible
that you forgot to specify target platform somewhere. So,
code generated by script is correct, but necessary #define
(or whatever) may be missing.



Re: WTL and winbase.h by foahchon

foahchon
Sat Sep 23 11:12:54 CDT 2006

Thanks for your replies everyone. Apparently, I have solved the
problem. It seems some of the header files VC's include directory are
corrupted. Even though I had downloaded a fresh SDK from Microsoft, and
added it's install directory to VC's include directories list, I forgot
to move it toward the top of the list so VC would look there first,
before searching the other directories for the older files. Stupid
mistake on my part.

Tim Roberts wrote:
> Is is possible that you have your own include file called winnt.h or
> windef.h in the include path that is interfering?

Apparently those files that were in my VC install directory were
somehow corrupted, despite the fact that I did a fresh install.

Alex Blekhman wrote:
> "foahchon" wrote:
> > Thanks for your reply. I didn't include anything; the
> > project was
> > generated by a script. I would have to assume that the
> > generator got
> > the #include order right. The same can be said about the
> > wxWidgets
> > framework package.
>
>
> I never used wxWidgets myself, however it may be possible
> that you forgot to specify target platform somewhere. So,
> code generated by script is correct, but necessary #define
> (or whatever) may be missing.

The instructions don't specify that any #defining is necessary; it
comes packaged with a .msw file, which can only apply to Windows, and
it should be as simple as selecting the components you want built
through Batch Build. Ideally, that is.

Thanks to all again for the replies, I appreciate it.