Troubleshooting
Problem
When compiling a Windows component an error occurs similar to below. > Compiling Element Element.cpp C:\Program Files\Microsoft Visual Studio\VC98\Include\winnt.h(161) : error C2143: syntax error : missing ';' before '*' C:\Program Files\Microsoft Visual Studio\VC98\Include\winnt.h(161) : error C2501: 'PCHAR' : missing storage-class or type specifiers
Cause
Looking at winnt.h (excerpt below) if VOID is not defined then the "typedef char CHAR;" is processed. If VOID is defined in your model or externally referenced source files, then CHAR will be undefined and an error will result.
//
// Basics
//
#ifndef VOID
#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
#endif
...
//
// ANSI (Multi-byte Character) types
//
typedef CHAR *PCHAR;
typedef CHAR *LPCH, *PCH;
...
Resolving The Problem
Users should always be cautious when defining things in their models. They should verify they are not overriding some define that exists for the Target Operating System or the Rose RealTime TargetRTS libraries.
To correct the error above, make sure VOID is not defined in your model. Then CHAR will be defined in winnt.h and the compilation error will not occur.
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21197591