• Advertisement
Sign in to follow this  

[OGRE] Undefined type

This topic is 4183 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I posted this on Ogre's forums but no one replied. I'm getting this error and I have no ide a why...
Quote:
1>..\source\CFrameListener.cpp(21) : error C2027: use of undefined type 'Ogre::InputReader' 1> c:\library\ogresdk\include\OgrePrerequisites.h(241) : see declaration of 'Ogre::InputReader' 1>..\source\CFrameListener.cpp(21) : error C2227: left of '->capture' must point to class/struct/union/generic type 1>..\source\CFrameListener.cpp(24) : error C2027: use of undefined type 'Ogre::InputReader' 1> c:\library\ogresdk\include\OgrePrerequisites.h(241) : see declaration of 'Ogre::InputReader' 1>..\source\CFrameListener.cpp(24) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type 1>..\source\CFrameListener.cpp(24) : error C2065: 'KC_ESCAPE' : undeclared identifier
CFrameListener.h
#include <OgreFrameListener.h>
#include <OgreEventListeners.h>
#include <OgreKeyEvent.h>

using namespace Ogre;

class CFrameListener : public FrameListener
{
public:
	// Constructor
	CFrameListener(InputReader *inputReader);
	
	// Frame Started - Called every frame
	bool frameStarted(const FrameEvent &event);

	// Frame Ended - Called every frame
	bool frameEnded(const FrameEvent &event);

private:
	InputReader *_inputReader;
};
CFrameListener.cpp
#include "CFrameListener.h"

/*
	Constructor
*/
CFrameListener::CFrameListener(InputReader *inputReader)
{
	_inputReader = inputReader;
}

/*
	Frame Started - Ran every frame
*/
bool CFrameListener::frameStarted(const FrameEvent &event)
{
	_inputReader->capture(); // LINE 21 ***

	//Exit if pressed Escape
	if(_inputReader->isKeyDown(KC_ESCAPE))
		return false;

	return true;
}

/* 
	Frame End - Ran every frame
*/
bool CFrameListener::frameEnded(const FrameEvent &event)
{
	return true;
}

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by DukeAtreides076
It looks like you're missing a header file include. Try including <OgreInput.h>

Thanks!

Share this post


Link to post
Share on other sites
It looks like InputReader has been forward declared, but not fully declared. That is why it does not object at the header file (which only contains pointers to InputReader), but does complain when you try to use it's members.

I think DukeAtreides076 is right; you need to include whatever header InputReader is defined in. (I don't use Ogre).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement