Search code examples
audioogreogre3dirrklang

Using IrrKlang with Ogre


I'm trying to set up sound in my Ogre3D project. I have installed irrKlang 1.4.0 and added it's include and lib directories to my projects VC++ Include and Library directories, but I'm still getting a Linker error when I attempt to build. Any suggestions?

(Error 4007 error LNK2019: unresolved external symbol "__declspec(dllimport) class irrklang::ISoundEngine * __cdecl irrklang::createIrrKlangDevice(enum irrklang::E_SOUND_OUTPUT_DRIVER,int,char const *,char const *)" (_imp?createIrrKlangDevice@irrklang@@YAPAVISoundEngine@1@W4E_SOUND_OUTPUT_DRIVER@1@HPBD1@Z) referenced in function "public: __thiscall SoundManager::SoundManager(void)" (??0SoundManager@@QAE@XZ)


Solution

  • Okay, after looking at this for awhile it seems I was making two mistakes.

    1. The lib directory for irrKlang is divided in two, so instead of adding (IRRKLANGDIRECTORY)\lib to my library directories, I should have been using (IRRKLANGDIRECTORY)\lib\Win32-visualStudio.

    2. Including the lib directory wasn't sufficient, I also needed to specify the use of the irrklang library file at the top of my class (#pragma comment(lib, "irrklang.lib")).