OgreAL fails to build on linux.

kowi

16-03-2007 20:43:43

Hi,

I need to build Ogre on Linux and here's what I get as error message:


if g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -DOGRE_GUI_gtk -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/include/OGRE -g -O2 -MT Listener.o -MD -MP -MF ".deps/Listener.Tpo" -c -o Listener.o Listener.cpp; \
then mv -f ".deps/Listener.Tpo" ".deps/Listener.Po"; else rm -f ".deps/Listener.Tpo"; exit 1; fi
Listener.cpp: In constructor ‘DeviceListener::DeviceListener(Ogre::RenderWindow*, Ogre::Camera*, Ogre::SceneManager*)’:
Listener.cpp:36: error: ‘class OIS::InputManager’ has no member named ‘numMice’
Listener.cpp:41: error: ‘class OIS::InputManager’ has no member named ‘numKeyboards’
make[2]: *** [listener.o] Fehler 1
make[2]: Verlasse Verzeichnis '/home/konrad/Desktop/qbic-dependencies/OgreAL/Demos/Basic_Demo'
make[1]: *** [all-recursive] Fehler 1
make[1]: Verlasse Verzeichnis '/home/konrad/Desktop/qbic-dependencies/OgreAL/Demos'
make: *** [all-recursive] Fehler 1


I'm using the SVN version of OgreAL and the CVS versions of OIS and Ogre. Ogre and OIS compiled fine.

What shall I do? Wait, until you fix this problem or get my hands dirty?
Is there a way to contact you on IRC?

Thx for this great lib! I used it on Windows with VC, already! With CB I had some ugly linking issues. I compiled ogg with MSYS myself, but vorbis didn't compile on windows. Now I'm back here in Linux ;)

PS: I saw your reply to this post: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=3670 But I don't know what you mean by that. Could explain it to me again, please!!!

Ciao

CaseyB

16-03-2007 21:18:43

There was an API change from the version of OIS that they settled on with Eihort and the current CVS head. I decided to use the API for OIS 1.0 since that's what is distributed in the Ogre Dependencies zip file. OIS has removedOIS::InputManager::OIS::InputManager::numMice()
OIS::InputManager::OIS::InputManager::numKeyboards()
in favor ofOIS::InputManager::getNumberOfDevices( Type iType );where you pass is the type of object you want to know about. For examplemInputManager->getNumberOfDevices(OIS::OISKeyboard);
I think that the new way (CVS Head) is cleaner, but like I said, I wanted to be compatible with Ogre. The reason that Ogre built fine is because they never actually test for the presence of devices! They just assume that everyone has a mouse and a keyboard and then wrap a try...catch() around the creation of the joystick.//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
mKeyboard = static_cast<Keyboard*>(mInputManager->createInputObject( OISKeyboard, bufferedKeys ));
mMouse = static_cast<Mouse*>(mInputManager->createInputObject( OISMouse, bufferedMouse ));
try {
mJoy = static_cast<JoyStick*>(mInputManager->createInputObject( OISJoyStick, bufferedJoy ));
}
catch(...) {
mJoy = 0;
}

I don't really like the idea of doing it that way, but you can remove the if's in the Listener.cpp files in the demos if you like. Or you could replace the tests withmInputManager->getNumberOfDevices(OIS::OISMouse) > 0
mInputManager->getNumberOfDevices(OIS::OISKeyboard) > 0
Or you could get the OIS-1.0 tag from CVS instead of the CVS Head version. For the first two options you're going to look for if(mInputManager->numMice() > 0)
{
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
}
if(mInputManager->numKeyboards() > 0)
{
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
mKeyboard->setEventCallback(this);
}
in the Listener.cpp files in the demos.

kowi

18-03-2007 11:52:32

Thank you for your fast and very long answer!!!

I fully understand what you mean now and respect your decisions on staying Ogre compatible.

As far as I understand you, I only have to change code in the OgreAL demos, right?

If that's so, the basic OgreAL library should compile when disabling the demos, right?

I've been looking for a configure option to disable the demos, but couldn't find it. Does it exist or is there a special make target I can call that only builds OgreAL?

Ciao
Kowi

kowi

18-03-2007 13:34:14

I managed to build OgreAL without the Demos:

cd OgreAL && \
chmod +x ./bootstrap && \
./bootstrap && \
./configure --prefix=/usr && \
make "SUBDIRS = src include" && \
sudo make "SUBDIRS = src include" install && \
cd ..


But it would be nice very if you introduce a command line switch.

Here's a link to a good site with an example: http://www.shlomifish.org/lecture/Autot ... NABLE.html

Thanks again, for this library!!!!

Kowi

CaseyB

18-03-2007 17:49:03

But it would be nice very if you introduce a command line switch. Here's a link to a good site with an example:Cool! Thank for that, I'll have a look at it! The fact is that I am a Windows developer (I am trying to reform my evil ways! ;) ) and know almost nothing about AutoMake, makefiles, etc. I appreciate the link! I really need to learn more about this!

vinvin

19-03-2007 07:29:22

The answer was in that post: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=3670
You just have to add the OIS compilation rules in configure.ac
add: PKG_CHECK_MODULES(OIS, OIS)
And change:
AC_SUBST(OGREAL_CFLAGS,"$OGRE_CFLAGS $VORBIS_FLAGS $OPENAL_FLAGS $OIS_CFLAGS")
AC_SUBST(OGREAL_LIBS, "$OGRE_LIBS $VORBIS_LIBS $OPENAL_LIBS $OIS_LIBS")

This is not a default. It must be because not everybody wants to run the samples, and OIS must not be needed to compile the lib, while it not needed for it.