title: Error: 'some class' does not name a type. how to resolve this?
body: <p>Sleepy programmer (self - acclaimed) need help </p>
  
  <pre><code>#ifndef GAME_H
  #define GAME_H
  #include &lt;iostream&gt;
  #include "snake.h"
  #include "food.h"
  #define MAX_WIDTH 20
  #define MAX_HEIGHT 20
  
  class game
  {
      public:
          game();
          static void createBoard();
          int gameStart();
          bool gameChecker();
  
      protected:
          food apple;
          bool gameOver = false;
          snake python;
          int gameSpeed = 250;
  
      private:
  };
  
  #endif // GAME_H
  </code></pre>
  
  <p>Above is header file called <strong>game.h</strong></p>
  
  <p>Whenever I try to compile the project it shows error saying "<strong>error: 'food' does not name a type</strong>"</p>
  
  <p>where <strong>food is another class</strong> which I have included in this header file too </p>
  
  <pre><code>#include 'food.h'
  </code></pre>
  
  <p>but still the error persists. I also, tried include the <strong>food.h</strong> in .cpp file of the game but still no hope.</p>
  
  <p>this is the food.h file in case you need it</p>
  
  <pre><code>#ifndef FOOD_H
  #define FOOD_H
  #include "game.h"
  #include "snakeFragment.h"
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  class food: public snakeFragment
  {
      public:
          food();
          int foodPlace();
          int printFood();
  
      protected:
          char symbol = '*';
  
      private:
  };
  
  #endif // FOOD_H
  </code></pre>
  
  <p>I am using Code::blocks.</p>
  
  <p><strong>Things I have done</strong></p>
  
  <ol>
  <li><p>Reparse the project</p></li>
  <li><p>Rebuild the entire project</p></li>
  <li><p>Rewriting the class again</p></li>
  <li><p>Restarting the laptop </p></li>
  <li><p>Restarting Code::blocks</p></li>
  <li><p>Provided the path in the compiler settings -> search directories</p></li>
  </ol>
  
  <p>but none worked. I don't know what is the problem ?</p>
  
  <p><strong>Thanks in advance</strong></p>