error: expected specifier-qualifier-list before xxx (a structure )

when I try to define a LIST_NODE structure in a my code,
it's alert "error: expected specifier-qualifier-list before LIST_NODE", which following so many error info:

error: ‘LIST_NODE’ has no member named ‘next’
error: ‘LIST_NODET’ has no member named ‘previous’
error: ‘LIST_NODE’ has no member named ‘previous’

I was astonished for a minutes:


typedef struct LIST_NODE
{
   void   *data;

   LIST_NODE   *next;

   LIST_NODE   *previous;


} LIST_NODE;


yeah, I found the error!
the structure is unnamed yet. I should gave it name so it can refer to itself
modified as follow, then erverthing would be ok:


typedef struct LIST_NODE
{
   void   *data;

   struct LIST_NODE   *next;

   struct LIST_NODE   *previous;


} LIST_NODE;


good luck!

你可能感兴趣的:(C,language,structure,list,struct)