[SOLVED]error of use OgreOggSound

haibo19981984

15-01-2010 08:10:00

I'm an ogre newer.I want to add sound to my project,so I try to use OgreOggSound.
I download both the SVN and .zip's OgreOggSound.
And direct copy the OgreOggSound_d.dll to bin\debug,and add Plugin=OgreOggSound_d to Plugins.cfg.
Copy the OgreOggSound_d.lib to my project lib.
There is no problem in compile process,but occur error in run,such as:
my project's error:

LDR: LdrpWalkImportDescriptor() failed to probe e:\ogrework\bin\Debug\OgreOggSound_d.dll for its manifest, ntstatus 0xc0150002


my project's attribute:
includes:
"$(OGRE_HOME)\OgreMain\include";
"$(OGRE_HOME)\Dependencies\include";
"$(OPENAL_SDK)\include\";
"..\Include\OgreOggSound-1.14"

Additional Libraries:
"$(OGRE_HOME)\lib";
"$(OGRE_HOME)\Dependencies\lib\$(ConfigurationName)";
"..\lib\$(ConfigurationName)";
"$(OPENAL_SDK)\libs\Win32"

Input:
OgreMain_d.lib
OIS_d.lib
OgreOggSound_d.lib

my project:

#include "ExampleApplication.h"
#include "OgreOggSoundManager.h"
class MyListener : public ExampleFrameListener
{
public:
SceneManager* mSceneMgr;
OgreOggSound::OgreOggSoundManager* mSoundManager;
public:
MyListener(SceneManager *sceneMgr, RenderWindow* win, Camera* cam, OgreOggSound::OgreOggSoundManager* SoundManager)
: ExampleFrameListener(win, cam)
, mSceneMgr(sceneMgr)
, mSoundManager(SoundManager)
{

}
bool frameStarted(const FrameEvent& evt)
{
if (!ExampleFrameListener::frameStarted(evt))
return false;

mSoundManager->update(evt.timeSinceLastFrame);

return true;
}
virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
{
using namespace OIS;
// t
OgreOggSound::OgreOggISound* mShotSound = mSoundManager->getSound("_sound");
if (mKeyboard->isKeyDown(OIS::KC_T)){
mShotSound->play();
}
return ExampleFrameListener::processUnbufferedKeyInput(evt);
}
};

class OgreOggSoundApp : public ExampleApplication
{
public:
OgreOggSoundApp()
{
}
~OgreOggSoundApp()
{
if (mSoundMgr)
delete mSoundMgr;
}
void createScene(void)
{
// ambient
mSceneMgr->setAmbientLight( ColourValue( 0.5, 0.5, 0.5) );

// Create a light
Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);

// camera
mCamera->setPosition(Vector3(0,50,80));
mCamera->lookAt(Vector3(0,0,-300));

// sound
mSoundMgr = OgreOggSound::OgreOggSoundManager::getSingletonPtr();
mSoundMgr->init();
OgreOggSound::OgreOggISound* mShotSound = mSoundMgr->createSound("_sound", "lvguang.ogg", false, true);

}
void createFrameListener(void)
{
mFrameListener = new MyListener(mSceneMgr, mWindow, mCamera, mSoundMgr);
mRoot->addFrameListener(mFrameListener);
}
public:
OgreOggSound::OgreOggSoundManager* mSoundMgr;
};

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char **argv)
#endif
{
// Create application object
OgreOggSoundApp app;

try {
app.go();
} catch( Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!",
MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
fprintf(stderr, "An exception has occured: %s\n",
e.getFullDescription().c_str());
#endif
}
return 0;
}

Anybody can give me a reply.

stickymango

17-01-2010 20:15:19

Note:- If your using VC2008 or higher you will need to recompile the lib, by default the lib comes pre-compiled for VC2005...

haibo19981984

18-01-2010 02:54:03

First,thanks for your reply.
My project is built in vs2005 and uses ogre1.64 and OpenAL1.1.
After I recompile the lib, there is no error in run.

stickymango

18-01-2010 09:11:21

Glad you got it sorted :)