title: Struct in Struct has no member
body: <p>Well this is my first post, I'm really sorry for what I'll do...
  I have a problem and I need to hurry, what I'm doing wrong?
  It's abut a "library" program about structures
  I have to files: an header with this structures</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  //Strutture
  struct Date{short day, month, year;};
  enum genre{thriller, novel, fantasy, horror};
  
  struct Book{char title[64];
      char writer[32];
      enum genre bookGenre;
      struct Date published;
      short inLibrary;
      short outLibrary;
      short id;
  };
  </code></pre>
  
  <p>And then a c file, this file contains only definitions; the main will be in another .c file:</p>
  
  <pre><code>#include "mylib.h"
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  ...
  
  //To add new book
  Book_t *newBook(){
  Book_t *bPtr;
  if ((bPtr = calloc(1,sizeof(Book_t))) == NULL){
      printf("I'm sorry, I couldn't reserve enough memory\n");
  }
  else{
  
  ...
  
  //Book genre
      while(genreOk ==0){
          printf("Insert new book's genre(0=thriller, 1=novel, 2=fantasy, 3=horror): ");
          scanf("%d",&amp;t);
          if(-1&lt; t &lt;4){
              (*bPtr).genre = t;
              genreOk =1;
          }
          else{
              printf("\nInapropriate genre, try again");
          }
          printf("\n");
      }
  
      //Data libro
      while(dateOk ==0){
          printf("Insert new book's day of publish: ");
          scanf("%d", &amp;dayT);
          printf("\nInsert new book's month of publish: ");
          scanf("%d", &amp;monthT);
          printf("\nInsert new book's year of publish: ");
          scanf("%d", &amp;yearT);
  
          dateOk = checkDate(dayT, monthT, yearT);
          if (dateOk == 1){
              (*bPtr).Date.day = dayT;
              (*bPtr).Date.month = monthT;
              (*bPtr).Date.year = yearT;
          }
          printf("\n");
  
      }
  More messy code
  </code></pre>
  
  <p>When I try to compile using gcc -c mylib.c I get this error:</p>
  
  <pre><code>mylib.c: In function newBook:
  mylib.c: error: 'Book_t {aka struct Book}' has no member named 'genre'
   (*bPtr).genre = t;
  mylib.c: error: 'Book_t {aka struct Book}' has no member named 'Date'
   (*bPtr).Date.day = dayT;
  mylib.c: error: 'Book_t {aka struct Book}' has no member named 'Date'
   (*bPtr).Date.month = monthT;
  mylib.c: error: 'Book_t {aka struct Book}' has no member named 'Date'
   (*bPtr).Date.year = yearT;
  </code></pre>
  
  <p>I'm using Virtual Box with Ubuntu on a Windows 10 machine</p>