1
Error   2   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 Sounds::Sounds(void)" (??0Sounds@@QAE@XZ)
C:\Users\Shum\Dropbox\DM2231_Lab(13)\DM2231_Lab\DM2231_Lab\Sounds.obj   DM2231_Lab

This is the error I've been getting when I tried to link the Irrklang sound to my current project. The strange thing is that its been working for all my other projects, and the only difference for this one is that I've updated the Irrklang files with the latest from their web.

#include <irrKlang.h>
using namespace irrklang;
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll

As far as I see, there is nothing wrong here. In my project properties, my linker input included the additional dependencies for irrKlang.lib. I know its in the right place since my freeglut.lib is working.

I THINK the problem is because it can see the header files, but cannot access the library (or the dll files). But my freeglut is working fine, its just irrklang that isn't. Really stumped.

I am using microsoft Visual Studios 2013.

NetVipeC
  • 4,402
  • 1
  • 17
  • 19
  • You have added the directory of the library to the `library search directories` in `Project Properties` and added the .lib dependency in `additional libraries`? – NetVipeC Aug 07 '14 at 15:25
  • @NetVipeC Yes I did, if what I think you are saying is what I think. In the general linker in project properties, I included the Additional Library Directories to where the lib file is. In the input, I added irrKlang.lib – user3368405 Aug 07 '14 at 15:32
  • Normally the problems with this error are the previous config or that the library (.lib) don't match the source. – NetVipeC Aug 07 '14 at 15:42
  • I'm still a student in C++, so would #pragma once actually cause it to have an error? – user3368405 Aug 07 '14 at 16:08
  • Somehow, downloading the 32 bit and replacing it from the 64 bit one I had fixed it. No idea why though, because my computer is 64 bit. I can't set it as resolved, can someone help? – user3368405 Aug 07 '14 at 16:13
  • 1
    You are compiling in 32bits or 64bits, the VS2013 compiler by default compile 32bits. [To confirgure to 64bits](http://msdn.microsoft.com/en-us/library/9yb4317s.aspx) – NetVipeC Aug 07 '14 at 16:19
  • Oh its was 32 bits. I never knew that there was a difference in the compiling. Thanks a bunch! – user3368405 Aug 08 '14 at 20:04

0 Answers0