title: Why it is showing error: expected ‘;’, identifier or ‘(’ before ‘struct’
body: <p>I am getting an error</p>
  
  <blockquote>
    <p>CC src/main.c In file included from src/main.c:8:0:
    src/../include/linkedlist.h:4:1: error: expected ‘;’, identifier or
    ‘(’ before ‘struct’  struct donorNode* getNewDonorNode();  ^~~~~~
    Makefile:294: recipe for target 'obj/main.o' failed make: ***
    [obj/main.o] Error 1</p>
  </blockquote>
  
  <p>See codes here - <a href="https://github.com/aman-roy/BloodBank" rel="nofollow noreferrer">https://github.com/aman-roy/BloodBank</a></p>
  
  <p><strong>linkedlist.h</strong></p>
  
  <pre><code>#ifndef LINKEDLIST_H_
  #define LINKEDLIST_H_
  
  struct donorNode* getNewDonorNode();
  struct acceptorNode * getNewAcceptorNode();
  
  struct donorBox* donorDBtoLL();
  struct acceptorBox* acceptorDBtoLL();
  
  void distroyAcceptor(struct acceptorNode *);
  void distroyDonor(struct donorNode *);
  
  struct donorNode * insertAtTopDonor(struct donorNode *, struct donorNode *);
  struct acceptorNode * insertAtTopAcceptor(struct acceptorNode *, struct acceptorNode *);
  
  #endif
  </code></pre>
  
  <p>linkedlist.c</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  
  #include "../include/linkedlist.h"
  #include "../include/containers.h"
  #include "../include/utilities.h"
  #include "../include/color.h"
  
  struct donorNode * getNewDonorNode()
  {
      struct donorNode *temp = (struct donorNode *)malloc(sizeof(struct donorNode));
      temp-&gt;next = NULL;
      return temp;
  }
  
  struct acceptorNode * getNewAcceptorNode()
  {
      struct acceptorNode *temp = (struct acceptorNode *)malloc(sizeof(struct acceptorNode));
      temp-&gt;next = NULL;
      return temp;
  }
  
  
  struct donorBox* donorDBtoLL()
  {
      FILE *fp = loadFile('d');
      if (!fp)
         return NULL;
      struct donorNode *temp = getNewDonorNode();
      struct donorBox *box = (struct donorBox *)malloc(sizeof(struct donorBox));
      if(fread(&amp;temp-&gt;data,sizeof(temp-&gt;data),1,fp))
      {
          int count = 0;
          struct donorNode *head = NULL;
          struct donorNode *front = NULL;
          rewind(fp);
  
          while(fread(&amp;temp-&gt;data,sizeof(temp-&gt;data),1,fp))
          {
              if (head == NULL)
              {
                  head = temp;
                  front = head;
                  temp = getNewDonorNode();
                  count++;
                  continue;
              }
              head-&gt;next = temp;
              head = temp;
              count++;
              temp = getNewDonorNode();
          }
          free(temp);
          fclose(fp);
  
          box-&gt;head = front;
          box-&gt;count = count;
      }
      else
      {
          box-&gt;head = NULL;
          box-&gt;count = 0;
          free(temp);
          printf(TD_BOLD TC_RED TD_UNDERLINE"\t\t\t\tNO DATA AVAILABLE!\n");
      }
      return box;
  }
  
  
  
  struct acceptorBox *acceptorDBtoLL()
  {
      FILE *fp = loadFile('a');
      if (!fp)
         return NULL;
      struct acceptorNode *temp = getNewAcceptorNode();
      struct acceptorBox *box = (struct acceptorBox *)malloc(sizeof(struct acceptorBox));
      if(fread(&amp;temp-&gt;data,sizeof(temp-&gt;data),1,fp))
      {
          int count = 0;
          struct acceptorNode *head = NULL;
          struct acceptorNode *front = NULL;
          rewind(fp);
  
          while(fread(&amp;temp-&gt;data,sizeof(temp-&gt;data),1,fp))
          {
              if (head == NULL)
              {
                  head = temp;
                  front = head;
                  temp = getNewAcceptorNode();
                  count++;
                  continue;
              }
              head-&gt;next = temp;
              head = temp;
              count++;
              temp = getNewAcceptorNode();
          }
          free(temp);
          fclose(fp);
  
          box-&gt;head = front;
          box-&gt;count = count;
      }
      else
      {
          box-&gt;head = NULL;
          box-&gt;count = 0;
          free(temp);
          printf(TD_BOLD TC_RED TD_UNDERLINE"\t\t\t\tNO DATA AVAILABLE!\n");
          sleep(2);
      }
      return box;
  }
  
  void distroyAcceptor(struct acceptorNode *head)
  {
      if (head == NULL)
      {
          return;
      }
      distroyAcceptor(head-&gt;next);
      free(head);
  }
  
  void distroyDonor(struct donorNode *head)
  {
      if (head == NULL)
      {
          return;
      }
      distroyDonor(head-&gt;next);
      free(head);
  }
  
  struct donorNode * insertAtTopDonor(struct donorNode * current, struct donorNode * head)
  {
      struct donorNode *temp = (struct donorNode *)malloc(sizeof(struct donorNode));
      temp-&gt;data = head-&gt;data;
  
      if (current == NULL)
      {
          current = temp;
          current-&gt;next = NULL;
      }
      else
      {
          temp-&gt;next = current;
          current = temp;
      }
      return current;
  }
  
  struct acceptorNode * insertAtTopAcceptor(struct acceptorNode * current, struct acceptorNode * head)
  {
      struct acceptorNode *temp = (struct acceptorNode *)malloc(sizeof(struct acceptorNode));
      temp-&gt;data = head-&gt;data;
  
      if (current == NULL)
      {
          current = temp;
          current-&gt;next = NULL;
      }
      else
      {
          temp-&gt;next = current;
          current = temp;
      }
      return current;
  }
  </code></pre>