AnsweredAssumed Answered

"illegal storage class" in header file

Question asked by Johannes Philippi on Aug 6, 2007
Latest reply on Aug 6, 2007 by CompilerGuru
Hello everybody,

I've got a problem with a typedef definition in header files.

In a special header file xxx.h (used just for type-definitions, without xxx.c-file) I declared three types:
#ifndef XXX_H#define XXX_Htypedef enum  {  XXX_INIT,  // list of states to be completed  ...,  ... } XXX_Status_Type;   typedef struct  {  UINT16 bVoltage; // Voltage  ... ... ;  ... ... ; } XXX_Request_Type;   typedef struct {  UINT8 index;    UINT16 vModule;   UINT8 tFE1,tFE2;   UINT8  t1,t2;        UINT8 tuC;    XXX_Status_Type status;  XXX_Request_Type smeR;   UINT8 CAN_OK,ADC_OK,IIC_OK; } XXX_Type;#endif

In the main.c of my application I include this header file, then I declare a global variable of the Type XXX_Type:

XXX_Type myXXX;

When compiling I allways get the error "illegal storage class" in the header file at the enum-declaration (XXX_Status_Type). The same applies for the struct-decalration (XXX_Request_Type).

I used this kind of structuring programs into header files and implementation files in older projects with other compilers(GNU) in other IDEs and it worked. I'm a bit surprised this is not working in CodeWarrior...

Has somebody got any suggestions for me?
I found the following thread in the forum already, but it does not apply to me. Code is correct as far as I can see, and "XXX_Status_Type" is not defined as macro anywhere I guess.


Message Edited by ohanica on 2007-08-06 08:45 AM