This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

OT - Need help debugging header file


I swear this worked yesterday, and I haven't altered it since then.  I
cannot see what's wrong with this code:

In file included from character.c:5:
character.h:9: error: expected identifier or '(' before 'int'
character.h:10: warning: no semicolon at end of struct or union
make: *** [character] Error 1

michael@camille ourrpg $ nl character.h
     1  /*character.h - Header file for the character struct and
function prototypes*/
     2  #ifndef __CHARACTER_H__
     3  #define __CHARACTER_H__
     4
     5  typedef struct
     6  {  
     7     char *name;   
     8     unsigned long currentHP, maxHP, currentMP, maxMP;   
     9     int xPos, int yPos;
    10  } character;
    11
    12  void printStats(character* c);
    13  character createCharacter(char* name, long maxHP, long maxMP);
    14  character scanCharacter(void);
    15
    16  #endif

The semicolon is there at the end of the typedef, and I don't see
anything that would remotely require a ( up there on line nine...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]