# Basic Question Regarding Programming in CodeWarrior [closed]

I have basic knowledge of C++ and MicroControllers. Please Consider the following code excerpt from the header file of MC9s08aw60(freescale), i am working with Codewarrior V5.9.

typedef union {
byte Byte;
struct {
byte PTFD0       :1;                                /* Port F Data Register Bit 0 */
byte PTFD1       :1;                                /* Port F Data Register Bit 1 */
byte PTFD2       :1;                                /* Port F Data Register Bit 2 */
byte PTFD3       :1;                                /* Port F Data Register Bit 3 */
byte PTFD4       :1;                                /* Port F Data Register Bit 4 */
byte PTFD5       :1;                                /* Port F Data Register Bit 5 */
byte PTFD6       :1;                                /* Port F Data Register Bit 6 */
byte PTFD7       :1;                                /* Port F Data Register Bit 7 */
} Bits;
} PTFDSTR;


Now, as far as i understand its defined as a struct and an object names "Bits" is also created but when i try to use the object in the CPP file, it shows an error such as: Bits not declared. Classname not specified. ';' missing.

Please tell me a simple reason for the same. And if this is not the right forum it,advise about an alternative.

Edit: Sorry for the obtuse expectation: this is how i used the code stated above;

Bits PTFD0 = 0x00; //considering logic 1 is low.

• How are you using it in your program? Show us the code. – Igor Skochinsky Nov 29 '12 at 12:40
• This looks like a pure C problem. What does it have to do with the IDE? – Olin Lathrop Nov 29 '12 at 14:14

PTFDSTR example;