Undefined reference: InputManager::getSingleton()


21-04-2011 16:45:16

Hello everyone.

I wanted to check if any widget is kurrently selected for keyboard input (mainly Edits :D) so I found InputManager::getKeyFocusWidget() to be a good idea. To get the InputManager instance I wanted to use InputManager::getInstance(); // or
but they are both "undefined references".

g++ output:CMakeFiles/server.dir/src/common/gamestate/GameState.cpp.o: In function `GameState::IsGUIFocused()':
/home/***/src/games/chars/src/common/gamestate/GameState.cpp:113: undefined reference to `MyGUI::InputManager::getInstance()'

Of course the rest works, so it should not be a wrong setup (or is there something else I have to link except libMyGUIEngine.so and libMyGUI.OgrePlatform.a ??



21-04-2011 17:15:11

Try this codeInputManager::getInstance().getKeyFocusWidget()and show me full liner output if error still exist.


21-04-2011 17:29:04

Sorry It was a project setup error. I forgot that I did not link my Server, which uses the same class, against mygui.. Gotta change my project setup. Thanks anyways, your snippet is what I am using.