title: Not declared in this scope despite the include of correct file
body: <p>I am trying to re-write a portion of lazyfoo.net's tutorial on mouse events just for the practice. I have re-thought my design after someone on this site suggested I do. I have decided to try adding a graphics class and also making sure that members of a class to not inherit from the class they are a member of, which was one of the problems the last time I posted a question. Please be patient with me because I am not a very experienced programmer and I am in the middle of learning SDL2.0.</p>
  
  <p>I am running Windows 10 on a 64-bit Dell laptop and using Code::Blocks 16.01.</p>
  
  <p>I tried googling this problem and I don't think any of the questions I found pertain to my specific problem, so after fixing a bunch of other errors I have finally came to an error that I don't know how to fix.</p>
  
  <p>After trying to compile the following code I get an error message that says "'mSpriteClips' was not declared in this scope" despite the fact that I included CentralClass, which is where mSpriteClips lives, into my cpp file.</p>
  
  <p>Here is the code.</p>
  
  <p>lbutton.cpp</p>
  
  <pre><code>#include "lbutton.h"
  #include "lButtonSprite.h"
  #include "global.h"
  #include "graphics.h"
  #include "ltexture.h"
  #include "central_class.h"
  
  LButton::LButton()
  {
      mButtonPosition.x = 0;
      mButtonPosition.y = 0;
  
      mCurrentSprite = button::MOUSE_OUT;
  }
  
  void LButton::setPosition( int x, int y )
  {
      mButtonPosition.x = x;
      mButtonPosition.y = y;
  }
  
  void LButton::handleEvent(SDL_Event* e)
  {
      //If mouse event happened
      if(e-&gt;type == SDL_MOUSEMOTION || e-&gt;type == SDL_MOUSEBUTTONDOWN || e-&gt;type == SDL_MOUSEBUTTONUP)
      {
          //Get mouse position
          int x, y;
          SDL_GetMouseState( &amp;x, &amp;y );
  
          //Check if mouse is in button
          bool inside = true;
  
          //Mouse is left of the button
          if(x &lt; mButtonPosition.x)
              inside = false;
          //Mouse is right of the button
          else if(x &gt; mButtonPosition.x + global::BUTTON_WIDTH)
              inside = false;
          //Mouse above the button
          else if(y &lt; mButtonPosition.y)
              inside = false;
          //Mouse below the button
          else if(y &gt; mButtonPosition.y + global::BUTTON_HEIGHT)
              inside = false;
  
          //Mouse is outside button
          if(!inside)
              mCurrentSprite = button::MOUSE_OUT;
      }
      //Mouse is inside button
      else
      {
          //Set mouse over sprite
          switch(e-&gt;type)
          {
          case SDL_MOUSEMOTION:
              mCurrentSprite = button::MOUSE_OVER_MOTION;
              break;
  
          case SDL_MOUSEBUTTONDOWN:
              mCurrentSprite = button::MOUSE_DOWN;
              break;
  
          case SDL_MOUSEBUTTONUP:
              mCurrentSprite = button::MOUSE_UP;
              break;
          }
      }
  }
  void LButton::render(Graphics &amp;graphics)
  {
      //Show current button sprite
      mButtonSpriteSheet-&gt;render(mButtonPosition.x, mButtonPosition.y, graphics, &amp;mSpriteClips[mCurrentSprite]);
  }
  </code></pre>
  
  <p>and the file that has the member that the compiler says is not declared.</p>
  
  <pre><code>#ifndef CENTRAL_CLASS_H_INCLUDED
  #define CENTRAL_CLASS_H_INCLUDED
  
  #include &lt;SDL.h&gt;
  #include "lButtonSprite.h"
  #include "global.h"
  #include "graphics.h"
  
  class LButton;
  
  class CentralClass : public Graphics
  {
      // Button objects
      LButton *mButtons[global::TOTAL_BUTTONS];
  
      // Mouse button sprite rectangles
      SDL_Rect mSpriteClips[button::TOTAL];
  
  public:
      // Call all functions
      CentralClass();
  
      // Starts up SDL and creates window
      bool init();
  
      // Loads media
      //bool loadMedia();
  
      // Main part of the program
      void mainLoop();
  
      // Frees media and shuts down SDL
      void close();
  
      // Clean up
      ~CentralClass();
  };
  
  #endif // CENTRAL_CLASS_H_INCLUDED
  </code></pre>
  
  <p>Any help is appreciated. I wish these error messages actually told you what the problem was. That would make coding much more enjoyable.</p>