Warum erhalte ich diese Neudefinition von Klassenfehlern?

Apologies for the code dump:

gameObject.cpp:

#include "gameObject.h"
class gameObject
{
    private:
    int x;
    int y;
    public:
    gameObject()
    {
    x = 0;
    y = 0;
    }

    gameObject(int inx, int iny)
    {
        x = inx;
        y = iny;
    }

    ~gameObject()
    {
    //
    }
    int add()
    {
        return x+y;
    }
};

gameObject.h:

class gameObject
{
    private:
    int x;
    int y;
    public:
    gameObject();

    gameObject(int inx, int iny);
    ~gameObject();
    int add();
};

Errors:

||=== terrac, Debug ===|
C:\terrac\gameObject.cpp|4|error: redefinition of `class gameObject'|
C:\terrac\gameObject.h|3|error: previous definition of `class gameObject'|
||=== Build finished: 2 errors, 0 warnings ===|

Ich kann nicht herausfinden, was los ist. Hilfe

Antworten auf die Frage(16)

Ihre Antwort auf die Frage