JacksonJones

Hello. I get the following errors when I try to include winnt.h in my code. I tried using the newest sdk as well as the previous release, and both files seem to generate the same errors. This must be a common problem, but I haven't seen the answer. I'm including stdio.h, xlcall.h, windef.h and winnt.h in my code. Maybe I need to include another header. Any help would be greatly appreciated. Thanks.

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(3857) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(3857) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(3857) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(8319) : error C2065: 'PCONTEXT' : undeclared identifier
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(8320) : error C2146: syntax error : missing ')' before identifier 'ContextRecord'
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(8320) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(8320) : error C2182: 'RtlCaptureContext' : illegal use of type 'void'
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(8320) : error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(8320) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winnt.h(9594) : error C3861: '__readfsdword': identifier not found

Results



Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

JacksonJones

I also get similar errors when including winbase.h. They all seem to focus around context and pcontext. here are the winbase.h errors in case anyone would find them helpful. I've seen a couple of threads on this problem, but none seemed to have a fool-proof solution. There has to be a fix for this problem. Thanks.

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winbase.h(779) : error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winbase.h(779) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winbase.h(779) : error C2378: 'PCONTEXT' : redefinition; symbol cannot be overloaded with a typedef

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winbase.h(779) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winbase.h(3155) : error C2061: syntax error : identifier 'LPCONTEXT'

C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\winbase.h(3163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int





Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

Vidhan

Hey Jack
I am trying to build a library (OpenCV) on the WM5 platform but it is giving me the same errors as your thread mentions.........have you come across with the solution please do tellme if you hav the solution.....im really stuck here ;-(
thank you
best wishes
vidhan

my errors:
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC
SDK\include\ARMV4I\winnt.h
(2976)......
error C2146: syntax error : missing ';' before identifier 'ContextRecord'
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC
SDK\include\ARMV4I\winbase.h(1414)........
error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
error C2061: syntax error : identifier 'LPCONTEXT'
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
error C2143: syntax error : missing ',' before '*'
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC
SDK\include\ARMV4I\excpt.h(63) ............
error C2040: 'PCONTEXT' : '_CONTEXT *' differs in levels of
indirection from 'int'
error C2378: 'LPCONTEXT' : redefinition; symbol cannot be overloaded
with a typedef"






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

jony

I get the same errors

1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winnt.h(2976) : error C2061: syntax error : identifier 'PCONTEXT'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winnt.h(2977) : error C2059: syntax error : '}'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(1414) : error C2061: syntax error : identifier 'LPCONTEXT'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(1414) : error C2059: syntax error : ';'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2117) : error C2146: syntax error : missing ')' before identifier 'lpContext'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2117) : error C2081: 'LPCONTEXT' : name in formal parameter list illegal
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2117) : error C2061: syntax error : identifier 'lpContext'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2117) : error C2059: syntax error : ';'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2118) : error C2059: syntax error : ')'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2125) : error C2143: syntax error : missing ')' before '*'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2125) : error C2143: syntax error : missing '{' before '*'
1>C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\include\ARMV4I\winbase.h(2126) : error C2059: syntax error : ')'

Though i'm using VS 2005 Professional Edition, GASPH!!!!!





Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

SOAC

HEY, I GET THE SAME ERROR LPCONTEXT!!

MY ERRORS WERE IN WINBASE.H AND EXCPT.H.

I THINK THE THREAD BEGINS IN THE STDLIB.H

THE ERROR THERE IS '_JBLEN'.

POST ME PLEASE IF YOU FIND THE SOLUTION.

I HAVE BEEN USING MVS 2005 STANDARD EDITION FOR A WEEK NOW

THANKS SOAC






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

Doofernow

Hi All
Has anyone got a fix for this Newbie to VC++ 2005 having very similar problems when using sepupapi.h. Have intalled latest R2 SDK.
Cheers
Doofernow




Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

sansliguy

Hey All,

I am trying to compile a c file with Visual C++ under windows xp. It gives an error related to pcontext which is included in winnt.h. I can not find any solution for this. Please let me know if anyone knows anyting about this.

Thanks.






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

SOAC

i had the same problem. what i did was rebuild my propject from scratch.

so all the include files are in their origional position

it worked for me, i got my exe file.






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

sansliguy

Hi Soac,

I changed the order of the include files and rebuilt the project. It worked. Thank you for the suggestion.






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

Intel Engineer

Hi,

I am having the same problem... Which include files order should I changed. I changed the order of all the include files but still ended up with the same error. More over I have not included winnt.h in any of my files.

Thanks,

Intel Engg.






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

Terry Jeanes

I am also having the same issues with include files in a project. Could you please advise how you changed the order of header file includes to get the project working correctly

I am using vendor supplied header files that work okay in visual studio 6, but not in VS8. My app is in VC++.






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

SOAC

the order in question is windows.h and excpt.h right before winnt.h

 

if you do this, u can see the order of your includes. it really helpful, and surprising!!!

from the menu bar,select:     project, configuation, c++,preprocessor

select generate preprossed file,  include line numbers

 






Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

Terry Jeanes

Thanks. windows.h include was what I needed.




Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

LinuxPenguin2

I had a similar problem building a dll. Rearranging includes did not help, but removing _WINDOWS from "Project properties->configuration properties->C/C++->Preprocessor->definitions" made it work.



Re: General Windows Vista Development Issues Errors in winnt.h file using visual c++ 2005 express edition and mar. 15 sdk

EmacsUser

Adding _MBCS should in that case do the trick when you don't want to remove _WINDOWS.