I have the following code that is generating an error when I try to build the application:
#define LPAFDU LPBYTE;
typedef struct appAfDataIndIeee_tag
{
integrPktHead_t head;
BYTE flags;
WORD dstShort;
BYTE dstEndpoint;
BYTE srcShort;
BYTE srcIeee[8];
WORD clusterId;
BYTE afduLength;
LPAFDU afdu; // <-- error
} appAfDataIndIeee_t;
This is the error it generates:
error C2208: ‘BYTE *’ : no members defined using this type
error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
If I switch out LPADFU for LPBYTE it compiles successfully. I would prefer to use a define or type-definition of LPADFU. Does anyone know how I can make this work? Thanks.
Get rid of the semicolon at the end of your
#define(it’s part of the macro):A far better way to do this, however, is to use
typedefrather than#define:The most important advantage of typedefs is that they obey scope rules.