Why is this code not compiling
<p>I am trying to write a makeshift renderer for the tutorials on
<a href="http://www.learnopengl.com" rel="nofollow">this site</a>. I have two classes SceneObject and RenderComponent. A SceneObject should contain a RenderComponent which should then draw the SceneObject. This is the code:</p>

<p>SceneObject.h</p>

<pre><code>#ifndef _SCENE_OBJECT_H
#define _SCENE_OBJECT_H

#include &lt;GLM/glm.hpp&gt;
#include &lt;GLM/gtc/matrix_transform.hpp&gt;
#include &lt;GLM/gtc/type_ptr.hpp&gt;
#include &lt;vector&gt;
#include &lt;iostream&gt;

#include "..\headers\shader.h"
#include "..\headers\rendercomponent.h"

class SceneObject {
private:
    glm::vec3 position;
    float *vertices;
    RenderComponent* renderComponent;
    std::vector&lt;Shader&gt; shaders;
public:
    SceneObject(glm::vec3, GLfloat*);
    ~SceneObject();
    bool init();
    RenderComponent&amp; getRenderComponent() const;
};

#endif
</code></pre>

<p>SceneObject.cpp</p>

<pre><code>#include "..\headers\sceneobject.h"

SceneObject::SceneObject(glm::vec3 pos, GLfloat* objectVertices) {
    this-&gt;position = pos;
    this-&gt;vertices = objectVertices;
    renderComponent = new RenderComponent(*this);
}

SceneObject::~SceneObject() {}

RenderComponent&amp; SceneObject::getRenderComponent() const {
    return *renderComponent;
}

bool SceneObject::init() {
    if (!renderComponent-&gt;initialize()) {
        return false;
    }
}
</code></pre>

<p>RenderComponent.h</p>

<pre><code>#ifndef _RENDER_COMPONENT_H
#define _RENDER_COMPONENT_H

#include &lt;GLM/glm.hpp&gt;
#include &lt;GLM/gtc/matrix_transform.hpp&gt;
#include &lt;GLM/gtc/type_ptr.hpp&gt;
#include &lt;iostream&gt;

#include "../headers/sceneobject.h"

class RenderComponent {
    SceneObject &amp;sceneObject;
public:
    RenderComponent(SceneObject&amp;);
    RenderComponent(const RenderComponent&amp;);
    bool initialize();
    void draw();

    SceneObject&amp; getSceneObject() const;
};

#endif
</code></pre>

<p>RenderComponent.cpp</p>

<pre><code>#include "..\headers\rendercomponent.h"

RenderComponent::RenderComponent(SceneObject&amp; obj)
    :sceneObject(obj){}

RenderComponent::RenderComponent(const RenderComponent&amp; ref)
    : sceneObject(ref.getSceneObject()){}

bool RenderComponent::initialize() {}

void RenderComponent::draw() {}

SceneObject&amp; RenderComponent::getSceneObject() const {
    return sceneObject;
}
</code></pre>

<p>The following errors are produced.</p>

<pre><code>Error   C2143   syntax error: missing ';' before '&amp;'    
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int
Error   C2238   unexpected token(s) preceding ';'   syntax error: identifier 'SceneObject'  
Error   C2143   syntax error: missing ';' before '&amp;'    
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    
Error   C2238   unexpected token(s) preceding ';'   
Error   C2664   'RenderComponent::RenderComponent(const RenderComponent &amp;)': cannot convert argument 1 from 'SceneObject' to 'const RenderComponent &amp;'  
Error   C2143   syntax error: missing ';' before '&amp;'    
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    
Error   C2238   unexpected token(s) preceding ';'   
Error   C2061   syntax error: identifier 'SceneObject'  
Error   C2143   syntax error: missing ';' before '&amp;'    
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    
Error   C2238   unexpected token(s) preceding ';'   
Error   C2143   syntax error: missing ';' before '*'    
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    
Error   C2238   unexpected token(s) preceding ';'   
Error   C2143   syntax error: missing ';' before '&amp;'    
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    
Error   C2238   unexpected token(s) preceding ';'   
</code></pre>

<p>From what i understand, the compiler is saying that SceneObject is not a type. I think this where the problem is. Any help is appreciated.</p>