C++ error - C2228, identifier not recognized as class
<p>Here is the relevant code:</p>

<p>Canvas.cpp</p>

<hr>

<pre><code>    #ifndef CANVAS
    #define CANVAS

    #include "graphicsDatatypes.h"

    class Canvas
    {
    private:

        // Current and next points to draw to
        struct cartesianPoint currentPoint, nextPoint;

    public:

        Canvas::Canvas() { numLinesDrawn = 0; };
        Canvas::~Canvas();  

        struct cartesianPoint getCurrentPoint() { return currentPoint; };

        void setCurrentPoint(int x, int y)
        {
            currentPoint.x = x;
            currentPoint.y = y;
        }


    };

#endif
</code></pre>

<hr>

<p>main.cpp</p>

<hr>

<pre><code>#include "glut-3.7.6-bin\glut.h"
#include "Canvas.cpp"

// Window size
int winWidth, winHeight;

// User's drawing space - current maximum of 4000 lines
Canvas userDrawSpace();

void callbackMouse(int button, int state, int x, int y)
{
    userDrawSpace.setCurrentPoint(x, y);
}
</code></pre>

<hr>

<p>The error I am getting is - error C2228: left of '.setCurrentPoint' must have class/struct/union    </p>

<p>Any idea why? The class is pretty clearly defined, and include should simply be bringing in the text. Visual studios recognizes that Canvas is a class when I hover over it with my mouse, so I have no clue what's going on. Any help is appreciated, thanks.</p>
