OgraAL class not found

kinggori

09-02-2007 05:29:23

hello once again guys

So far I've managed to install OgreAL, set global variables and run the demos

Now I'm trying to add sound to a game I already have but my code can't seem to locate OgreAL

Here is my structure:

mydev
|--freealut-1.1.0-bin
|--OgreAL
|--vorbis
|--ogrenew
|--ogg
|--mygame
|---scripts
|----mygame.sln

I opened mygame.sln and...

in OgreApp::OgreApp() i added:
soundManager = new OgreAL::SoundManager(sceneMgr);

and in ogreapp.cpp and added in the OgreApp::createScene()
OgreAL::Sound *sound = soundManager->createSound("Roar", "roar.wav", true);
node->attachObject(sound);
sound->play();



when i try building i get many errors relating to sound some of which are:

Error 1 error C2065: 'soundManager' : undeclared identifier
Error 2 error C2653: 'OgreAL' : is not a class or namespace name
Error 3 error C2061: syntax error : identifier 'SoundManager'

Error 5 error C2065: 'Sound' : undeclared identifier

.....


so apparently my game can't see the OgreAL libraries :(

any suggestions on how i could fix this?

t0tAl_mElTd0wN

09-02-2007 05:36:24

Always gotta check the obvious: Did you link it?

kinggori

09-02-2007 05:40:38

nope :)

noob question: how do i link it?
and can i just link the OgreAL_d.dll?

t0tAl_mElTd0wN

09-02-2007 05:49:42

Actually, if you look in your build directory, you should see OgreAL_d.lib and OgreAL_d.dll - in Visual Studio, you want to link to OgreAL_d.lib, and then before you run it, make sure OgreAL_d.dll is in your computer's search path.

CaseyB

09-02-2007 06:42:54

Even before you worry about linking it you'll need to add the OgreAL include path to your include list.

kinggori

10-02-2007 18:10:11

Even before you worry about linking it you'll need to add the OgreAL include path to your include list.

okies, so here's what I've done so far:

I right click on my project name in VS05 and click on properties
I then choose "All Configurations" then go to "Linker" -> "General" and under "Additional Library Directories" I add:

"C:\mydev\OgreAL\lib\$(ConfigurationName)"

do I need to do something else?

CaseyB, how do I add the OgreAL include path to my include list in VS?

CaseyB

10-02-2007 18:45:28

Click on your project name then click on properties and choose "All Configurations" then go to "C/C++" -> "General" and under "Additional Include Directories" add

"C:\mydev\OgreAL\include"

kinggori

10-02-2007 21:10:13

Thanks CaseyB
i made these changes

now when I include:
#include "OgreALListener.h"
#include "OgreALSoundManager.h"

I get the error:
Error 1 fatal error C1083: Cannot open include file: 'xram.h': No such file or directory c:\mydev\ogreal\include\OgreALPrereqs.h 13

i searched for xram.h but it's not in any of the folders

t0tAl_mElTd0wN

10-02-2007 22:03:31

That file comes with the OpenAL SDK.
http://www.openal.org/downloads.html

kinggori

11-02-2007 17:55:20

just in case someone has the same problem here is how i fixed it:

open VS05
right click on project -> properties -> C/C++ -> General -> "Additional Include Directories" --> add "C:\Program Files\OpenAL 1.1 SDK\include" or whatever directory your openAL is stored in

CaseyB

11-02-2007 18:40:26

Did you follow the instructions in the "Set-up Thread" at the top of this forum? Because that should have been taken care of by setting the OPENAL_SDK environment variable.