Can you see where my Undefined Identifier error is coming from?
<p>I have a struct 'GLpoint', defined in my NormalCalculator.h. For some reason when I define a function in the .cpp file that returns a GLpoint, the red squiggly line tells me that "identifier GLpoint is undefined". Literally on the return type of the funtion. The function that this occurs-in is:</p>

<p><code>GLpoint NormalCalculator::computeFaceNormal(GLface faceToNormal)</code></p>

<p>The error log also tells me that there is a missing ";" before the function definition. I cannot see where either of these are coming from. Especially as the last thing that happens before the definition of computeFaceNormals is</p>

<pre><code>else return false;
</code></pre>

<p>The code can be found below.</p>

<p>NormalCalculator.h</p>

<pre><code>#pragma once

#include &lt;vector&gt;
#include &lt;GL/glut.h&gt;


class NormalCalculator
{

struct GLpoint
{
    GLfloat x,y,z;
};

struct GLface
{
    GLfloat x1,y1,z1,x2,y2,z2,x3,y3,z3;
};

public:
    NormalCalculator(void);
    ~NormalCalculator(void);
    //put all of the face normal functions together 
    void generateFaceNormals(std::vector&lt;GLfloat&gt;* vertexArray, std::vector&lt;GLubyte&gt;* indexArray, std::vector&lt;GLfloat&gt;* normalArray);


private:
    //creates the line vectors from the the 3 points passed in as a part of the GLface
    void createLineVectorsFromFace(GLface facePassedIn, GLpoint* l_vec1, GLpoint* l_vec2); 
    //generates a normal vector for the 2 line vectors made by createLineVectorsFromFace
    void crossProductOfVecs(GLpoint* l_vec1, GLpoint* l_vec2, GLpoint* outPutNormal);
    //alters the normal vector so that it is of Unit length
    bool normalizeVector(GLpoint* normalVector, GLpoint* normalizedNormalVecContainer);
    GLpoint computeFaceNormal(GLface faceToNormal);
};
</code></pre>

<p>NormalCalculator.cpp</p>

<pre><code>#include "NormalCalculator.h"
#include &lt;gl/glut.h&gt;
#include &lt;math.h&gt;
#include &lt;iostream&gt;





void NormalCalculator::createLineVectorsFromFace(GLface facePassedIn, GLpoint* l_vec1, GLpoint* l_vec2)
{
    //from verts 1 &amp; 2 initialize l_vec1
    l_vec1-&gt;x = facePassedIn.x1 - facePassedIn.x2;
    l_vec1-&gt;y = facePassedIn.y1 - facePassedIn.y2;
    l_vec1-&gt;z = facePassedIn.z1 - facePassedIn.z2;
    //do that same for l_vec2 from face 2 and 3
    l_vec2-&gt;x = facePassedIn.x2 - facePassedIn.x3;
    l_vec2-&gt;y = facePassedIn.y2 - facePassedIn.y3;
    l_vec2-&gt;z = facePassedIn.z2 - facePassedIn.z3;
}


void NormalCalculator::crossProductOfVecs(GLpoint* l_vec1, GLpoint* l_vec2, GLpoint* outPutNormal)
{
    //cross product dat hoe
    outPutNormal-&gt;x = (l_vec1-&gt;y * l_vec2-&gt;z) - (l_vec1-&gt;z * l_vec2-&gt;y);//x = aybz-byaz
    outPutNormal-&gt;y = (l_vec1-&gt;z * l_vec2-&gt;x) - (l_vec1-&gt;x - l_vec2-&gt;z);//y = azbx-bzax
    outPutNormal-&gt;z = (l_vec1-&gt;x * l_vec2-&gt;y) - (l_vec1-&gt;y - l_vec2-&gt;x);//z = axby-bxay
}


bool NormalCalculator::normalizeVector(GLpoint* normalVector, GLpoint* normalizedNormalVecContainer)
{
    //first we must work out the magnitude of the normal vector
    GLfloat mag = (sqrt((float) pow(normalVector-&gt;x,2) + pow(normalVector-&gt;y,2) + pow(normalVector-&gt;z,2)));

    if(mag)
    {
        normalizedNormalVecContainer-&gt;x = normalVector-&gt;x/mag;
        normalizedNormalVecContainer-&gt;y = normalVector-&gt;y/mag;
        normalizedNormalVecContainer-&gt;z = normalVector-&gt;z/mag;
        return true;
    }

    else return false;

}

GLpoint NormalCalculator::computeFaceNormal(GLface faceToNormal)
{
    //first we create a couple of container GLpoints for our 2 line vectors
    GLpoint a;
    GLpoint b;
    createLineVectorsFromFace(faceToNormal, &amp;a, &amp;b);
    //Create a container for our origional normal
    GLpoint firstNorm;
    //We have our line vectors, and a container. Now cross product them and put them in the container.
    crossProductOfVecs(&amp;a, &amp;b, &amp;firstNorm);
    //create out last normal container
    GLpoint finalNorm;
    //normalize it
    normalizeVector(&amp;firstNorm, &amp;finalNorm);

    return finalNorm;
}



NormalCalculator::NormalCalculator(void)
{
}

NormalCalculator::~NormalCalculator(void)
{
}
</code></pre>
