I'm on Ubuntu Linux 10.10. WIth OGRE 1.7.2 and OIS 1.2 trying out the OGRE tutorial/examples and they compile fine. When I try to run OGRE after I choose the video settings, I get thrown the following error in the terminal:
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
*** Initializing OIS ***
Segmentation faultI looked everywhere on Google, OIS Forums, OGRE forums but it said little to no details (for hours I might add). So I will write this thoroughly with better details as far as debugging.
This was difficult to debug, since I lost control of my keyboard and mouse after these lines:
BaseApplication.cpp: mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));After I commented them out I was able to continue to see where the segment fault ocurred.
I got to this piece of code where the segment fault occurs:
BaseApplication.cpp:
void BaseApplication::windowResized(Ogre::RenderWindow* rw)
{
unsigned int width, height, depth;
int left, top;
rw->getMetrics(width, height, depth, left, top);
const OIS::MouseState &ms = mMouse->getMouseState();
ms.width = width;
ms.height = height;
}When the breakpoint hits:
ms.width = width;It is where I get the segment fault. The problem may be the line before it (I think) when it calls to OISMouse.h from class mMouse->getMouseState();
OISMouse.h:class _OISExport Mouse : public Object
{...
/** @remarks Returns the state of the mouse - is valid for both buffered and non buffered mode */
const MouseState& getMouseState() const { return mState; }
...}
When debugging, these are the variables and values of OISMouse.hName:
Value:[mListener]
"Cannot access memory at address 0x54" [mState]
"Cannot access memory at address 0x18" ------------------------------------
And when it hits
ms.width = width; I get the following debugging information:
Name:
Value:[mMouse]
0x0 [ms]
(const OIS::MouseState &) @0x18: <error reading variable> [ms.width]
"Cannot access memory at address 0x18" [width]
800 -----------------------------
Here's other debugging information (if it helps) of when I hit the line before "ms.width = width;"
http://img534.imageshack.us/img534/9020/debugging.pngSome more debugging information from variable "ms" from the picture above:
"(const OIS::MouseState &) @0xbffff518: {width = -1073744184, height = 134533926, X = {<OIS::Component> = {cType = 3221223236}, abs = -1217522048, rel = -1073744316, absOnly = false}, Y = {<OIS::Component> = {cType = 6856692}, abs = -1215421172, rel = 3698673, absOnly = 244}, Z = {<OIS::Component> = {cType = 3084862184}, abs = 6829016, rel = 7965004, absOnly = 72}, buttons = 138323333}"
If anyone could point me to what's wrong and how I could fix it I would greatly appreciate it. Thanks!