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:
#ifndef FILE_H
#define FILE_H
//file contents here
#endif
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
#pragma once
but this isn't supported by all compilers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With