title: dereferencing pointer to incomplete type when accessing members of a struct pointer
body: <p>I have the following sample code :</p>
  
  <p>person.h</p>
  
  <pre><code>typedef struct person Person;
  Person* makePerson(char* n, int i);
  </code></pre>
  
  <p>person.c</p>
  
  <pre><code>#include "person.h"
  struct person {
      char* name;
      int age;
  };
  
  Person* makePerson(char* n, int i) {
      Person person;
      person.name = n;
      person.age = i;
      return &amp;person;
  }
  </code></pre>
  
  <p>main.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "person.h"
  int main() {
      Person* pp = makePerson("Mark",24);
      printf("Person's name : %s\t Person's age : %d\n",pp-&gt;name, pp-&gt;age);
  }
  </code></pre>
  
  <p>I am getting an error of "dereferencing pointer to incomplete type" when I attempt to print out the name and age members that correspond to the Person pointer, pp. </p>
  
  <p>I am using gcc-std=c99 -o main main.c person.c to compile</p>
  
  <p>Can anyone give me some guidance? Thanks</p>