I have this compiler error (C2011) with this piece of code. I don’t know what is wrong with it.
The namespace (Ogre) doesn’t have a definition for PlaneMovement. I also tried a different name and still the same errors.
#include <Ogre.h>
using namespace Ogre;
class PlaneMovement
{
public:
PlaneMovement(Degree startingAngle, Real velocity = 2, Real gravity = 2);
Vector2 updateMovement(const FrameEvent& evt);
private:
Degree currentAngle;
Real currentVelocityX;
Real currentVelocityY;
Real gravity;
bool top;
};
Include guards:
Header files should have include guards for this exact reason – multiple inclusion in the same translation unit can lead to a multiple definition.
The alternative is using
but this isn’t supported by all compilers.