Not name a type error C++
<p>I've looked through other questions on this error but they're not helping me. I'm still new to C++ and I don't know if I'm misunderstanding something, misusing something, or just plain missing something but I can't figure out what and I need some help. My error I'm getting is</p>

<blockquote>
  <p><strong>SpriteImage does not name a type</strong></p>
</blockquote>

<p><strong>Sprite.cpp</strong></p>

<pre><code>#include "Sprite.h"
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include &lt;iostream&gt;
#include &lt;vector&gt;

namespace ColdFusion
{
Sprite::Sprite()
{
    bufferSize = 100;
}

void Sprite::addToBuffer(SpriteImage img)
{
    if(SpriteBuffer-&gt;size() == bufferSize)
    {
        bufferSize *= 2;
        SpriteBuffer-&gt;resize(bufferSize);
    }
    SpriteBuffer-&gt;push_back(img);
}

SpriteImage Sprite::getFromBuffer(int index) //**Here is the error**
{
    return SpriteBuffer[index];
}

void Sprite::removeFromBuffer(int index)
{
    SpriteBuffer-&gt;erase(SpriteBuffer.begine()+index);
}

void Sprite::removeFromBuffer(SpriteImage index)
{
    for(int j = 0; j &lt;= SpriteBuffer-&gt;size(); j++)
    {
        if(SpriteBuffer[j].name == index.name)
        {
            removeFromBuffer(j);
        }
    }
}

void Sprite::applyToScreen(SpriteImage img, SDL_Surface* destination)
{
    applyImage(img.x, img.y,getImage(img.filepath),destination)
}

SDL_Surface* Sprite::getImage(std::string filepath)
{
    SDL_Surface* optimized = NULL;
    SDL_Surface* loaded = NULL;
    loaded = IMG_Load(filepath.c_str());

    if(loaded != NULL)
    {
        optimized = SDL_DisplayFormat(loaded);
        SDL_FreeSurface(loaded);
        return optimized;
    }
    return NULL;
}

void Sprite::applyImage(int x, int y, SDL_Surface* source, SDL_Surface* destination)
{
    SDL_Rect offset;
    offset.x = x;
    offset.y = y;
    SDL_BlitSurface(source, NULL, destination, &amp;offset);
}

Sprite::~Sprite()
{

}
}
</code></pre>

<p><strong>Sprite.h</strong></p>

<pre><code>#ifndef SPRITE_H
#define SPRITE_H

#include "SDL/SDL.h"
#include &lt;iostream&gt;
#include &lt;vector&gt;

namespace ColdFusion
{
class Sprite
{
    public:
        Sprite();
        ~Sprite();
        typedef struct SpriteImage{
            int x;
            int y;
            std::string name;
            std::string filepath;
        };
        void addToBuffer(SpriteImage img);
        SpriteImage getFromBuffer(int index);
        void removeFromBuffer(int index);
        void removeFromBuffer(SpriteImage index);
        void applyToScreen(SpriteImage img, SDL_Surface* destination);

    protected:
    private:
        int bufferSize;
        std::vector&lt;SpriteImage&gt; SpriteBuffer[100];
        SDL_Surface* image;
        SDL_Surface* getImage(std::string filepath);
        void applyImage(int x, int y, SDL_Surface* source, SDL_Surface* destination);

};
}

#endif
</code></pre>
