Page 1 of 1

Error, while trying to install CEGUI

Posted: Thu Oct 29, 2009 14:02
by kanesoban
Hi all

When i try to make install CEGUI, i get this error:

CEGuiOgreBaseApplication.cpp:218: error: ‘class OIS::InputManager’ has no member named ‘numKeyBoards’
CEGuiOgreBaseApplication.cpp:225: error: ‘class OIS::InputManager’ has no member named ‘numMice’

I noticed, that someone else had the same problem:

viewtopic.php?p=13287&highlight=
(look at the 4th post)

The suggested solution for this is:

The fix for it is already in the source file. If you go to the location of the errors you should find a commented line for each error instance - if you comment the error line and uncomment the other line, you should find it compiles successfully.


I looked in CEGuiOgreBaseApplication.cpp, and there is no commented code whatsoever in that file, not around the lines that cause the errors, nor anywhere else.
Am i missing something? Could perhaps someone post the two correct lines of code?

Here is the function where the error occurs copied and pasted here:

Code: Select all

CEGuiDemoFrameListener::CEGuiDemoFrameListener(CEGuiBaseApplication* baseApp, Ogre::RenderWindow* window, Ogre::Camera* camera, bool useBufferedInputKeys, bool useBufferedInputMouse)
{
    // OIS setup
    OIS::ParamList paramList;
    size_t windowHnd = 0;
    std::ostringstream windowHndStr;

    // get window handle
    window->getCustomAttribute("WINDOW", &windowHnd);
   
    // fill param list
    windowHndStr << (unsigned int)windowHnd;
    paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));

    // create input system
    d_inputManager = OIS::InputManager::createInputSystem(paramList);

    // create buffered keyboard
    if (d_inputManager->numKeyBoards() > 0)
    {
        d_keyboard = static_cast<OIS::Keyboard*>(d_inputManager->createInputObject(OIS::OISKeyboard, true));
        d_keyboard->setEventCallback(this);
    }

    // create buffered mouse
    if (d_inputManager->numMice() > 0)
    {
        d_mouse = static_cast<OIS::Mouse*>(d_inputManager->createInputObject(OIS::OISMouse, true));
        d_mouse->setEventCallback(this);
       
        unsigned int width, height, depth;
        int left, top;

        window->getMetrics(width, height, depth, left, top);
        const OIS::MouseState& mouseState = d_mouse->getMouseState();
        mouseState.width = width;
        mouseState.height = height;
    }

    // store inputs we want to make use of
    d_camera = camera;
    d_window = window;

    // we've not quit yet.
    d_quit = false;

    // setup base app ptr
    d_baseApp = baseApp;
}


Re: Error, while trying to install CEGUI

Posted: Thu Oct 29, 2009 17:41
by Jamarr
Please don't ever double-post. It is highly frowned upon.

Also, you did not post the version of CEGUI you are using. This makes it difficult to fully answer your question since different versions can have different semantics.

In regards to your problem, what search term did you try? I found several threads off of "numKeyBoards" which lead me to believe OIS at one point simply changed the name of the two methods in question (numKeyBoards and numMice). Logically it would make sense to look up these two functions in whatever version of OIS you are using and then change the code to use those function names instead? For example, as noted in this thread numKeyBoards was changed to numKeyboards.

Re: Error, while trying to install CEGUI

Posted: Thu Oct 29, 2009 18:33
by kanesoban
Please don't ever double-post. It is highly frowned upon.

Sorry, i didn't realise that i double posted. I will try to be more careful next time.

Also, you did not post the version of CEGUI you are using.

0.6.0

In regards to your problem, what search term did you try?

It didn't even occur to me to search the forums, i only googled certain keywords, that's how i found that forum post. But now searching for 'numKeyboard' turned up this post:

viewtopic.php?f=10&t=3202&p=14537&hilit=numKeyBoards#p14537

The post explained what has to be changed for what, so now i was able to install CEGUI, and the CEGUI Layout editor.

So thanks !