title: Error when defining a struct
body: <p>I am attempting to write a simple linked list just for practice and to jog my memory a little bit, but I have ran into trouble.  I am pretty inexperienced in C, and I don't understand why this isn't working.  I am trying to define a Node and a LinkedList struct, but every time I try to compile I get an error saying Node is an unknown type.  I'm sure I am missing something, but I can't figure this out.  Thanks all!</p>
  
  <p>This is my ll.h file</p>
  
  <pre><code>  1 #ifndef ll_h
    2 #define ll_h
    3 
    4 #include &lt;stdio.h&gt;
    5 
    6 typedef struct {
    7     void *data;
    8     Node *next;
    9     Node *prev;
   10 } Node;
   11 
   12 
   13 typedef struct {
   14     Node *first;
   15     Node *last;
   16     int size;
   17 } LinkedList;
   18 
   19 
   20 void *getData(LinkedList list, int index);
   21 int getSize(LinkedList list);
   22 void *deleteNode(LinkedList, int index);
   23 void add(LinkedList list, void *data);
   24 void freeList(LinkedList list);
   25 
   26 #endif           
  </code></pre>
  
  <p>Errors I am receiveing</p>
  
  <pre><code>cc -Wall -g   -c -o ll.o ll.c
  In file included from ll.c:3:0:
  ll.h:8:5: error: unknown type name ‘Node’
  ll.h:9:5: error: unknown type name ‘Node’
  ll.c: In function ‘getData’:
  ll.c:8:18: error: expected expression before ‘LinkedList’
  ll.c:12:7: warning: assignment from incompatible pointer type [enabled by default]
  ll.c: In function ‘getSize’:
  ll.c:21:12: error: expected expression before ‘LinkedList’
  ll.c: In function ‘deleteNode’:
  ll.c:26:18: error: expected expression before ‘LinkedList’
  ll.c:32:7: warning: assignment from incompatible pointer type [enabled by default]
  ll.c:37:12: error: request for member ‘next’ in something not a structure or union
  ll.c:38:12: warning: assignment from incompatible pointer type [enabled by default]
  ll.c:40:12: error: request for member ‘next’ in something not a structure or union
  ll.c: In function ‘add’:
  ll.c:52:16: warning: assignment from incompatible pointer type [enabled by default]
  ll.c:54:21: warning: assignment from incompatible pointer type [enabled by default]
  ll.c: In function ‘freeList’:
  ll.c:61:18: error: expected expression before ‘LinkedList’
  ll.c:62:18: warning: initialization from incompatible pointer type [enabled by default]
  ll.c:65:7: warning: assignment from incompatible pointer type [enabled by default]
  ll.c:67:7: warning: assignment from incompatible pointer type [enabled by default]
  ll.c:62:11: warning: variable ‘next’ set but not used [-Wunused-but-set-variable]
  ll.c:60:9: warning: unused variable ‘i’ [-Wunused-variable]
  ll.c: In function ‘main’:
  ll.c:85:6: error: ‘LinkedList’ has no member named ‘add’
  ll.c:91:10: warning: dereferencing ‘void *’ pointer [enabled by default]
  ll.c:91:10: error: void value not ignored as it ought to be
  ll.c: In function ‘getSize’:
  ll.c:22:1: warning: control reaches end of non-void function [-Wreturn-type]
  make: *** [ll.o] Error 1
  </code></pre>