Advertisement Jump to content
Sign in to follow this  
Mr_Fhqwhgads

[OGRE] Undefined type

This topic is 4548 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!