Answered by:
Winnt.h

-
I am trying to build my code in MS Visual C++ with PSDK Server 2003 R2.
I cant get past these errors, these are not even in my code!
c:\program files\microsoft platform sdk\include\winnt.h(3858) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
c:\program files\microsoft platform sdk\include\winnt.h(3858) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk\include\winnt.h(3858) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk\include\winnt.h(8320) : error C2065: 'PCONTEXT' : undeclared identifier
c:\program files\microsoft platform sdk\include\winnt.h(8321) : error C2146: syntax error : missing ')' before identifier 'ContextRecord'
c:\program files\microsoft platform sdk\include\winnt.h(8321) : warning C4229: anachronism used : modifiers on data are ignored
c:\program files\microsoft platform sdk\include\winnt.h(8321) : error C2182: 'RtlCaptureContext' : illegal use of type 'void'
c:\program files\microsoft platform sdk\include\winnt.h(8321) : error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed
c:\program files\microsoft platform sdk\include\winnt.h(8321) : error C2059: syntax error : ')'
c:\program files\microsoft platform sdk\include\winnt.h(9595) : error C3861: '__readfsdword': identifier not found
Any help would be much appreciated.
Question
Answers
-
PCONTEXT should be defined in the same header, winnt.h. Because CPU context is platform-specific, it defined using architecture cheks, like #ifdef _IA64_ for Itanium CPU. In your case, PCONTEXT is not defined, so there is something wrong with platform-based macroses. You could manually (by looking through winnt.h) check which define is required to allow correct CONTEXT structure to be defined in order to troubleshoot the problem.
All replies
-
Hmm, are you including windows.h and coming up with these errors or are you just including winnt.h. If you want to use things from winnt.h you should include windows.h and then set the macros accordingly. Please see http://msdn2.microsoft.com/en-us/library/aa383745.aspx for information on the macros.
-
PCONTEXT should be defined in the same header, winnt.h. Because CPU context is platform-specific, it defined using architecture cheks, like #ifdef _IA64_ for Itanium CPU. In your case, PCONTEXT is not defined, so there is something wrong with platform-based macroses. You could manually (by looking through winnt.h) check which define is required to allow correct CONTEXT structure to be defined in order to troubleshoot the problem.
-
-
-