Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, Just deploying irrKlang into my application. (Windows 8.1, VS 2012 Express, Win32) So, having placed the include files into the root include folder and the lib file into the lib folder and having added the lib to the project properties linker section and added the header include to my source and added "using namespace irrklang;" and then in the constructor testing it out by initializing it thusly: ISoundEngine* engine = createIrrKlangDevice(); if (!engine) cout<<"irrklang failed.\n"; else cout<<"Irrklang initialized..\n"; It bombs out on compilation with: 1>main.obj : error LNK2001: 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) Which looks like a linker problem, but I'm sure I put the 32-bit version for which I'm using into the Program Files (x86) \....lib\ folder.. So what's wrong? Thanks and regards, Kinger ![]() |
||||
|
You didn't link to the irrklang.lib file. You need to add the .lib toyour linker settings. Or, more simpler, add the line pragma comment(lib, "irrklang.lib") to your code. Then it should work. (Update: With a 'hash' before the 'pragma', but this forum swallows that) |
||||
|
Ok, but I thought that step was also achieved by adding the irrklang.lib to the Additional Libraries section under Project Settings -> Linker. No? I understood that the pragma line was just the quick-n-dirty way of doing that. Am I misunderstanding that? Thanks & regards, Kinger |
||||
|
I'm not at my workstation right now, but do you provide an irrklang.lib that is static and another that is not static? I'm making the project dll linked because of other dependencies and I bought the professional version and am using the lib that came with that.. Could that be the problem? Is static linking the only functional benefit from using the purchased irrklang.lib? |
||||
|
Yes, there are two different ones. One is for static linkage (the one from irrKlang pro, it is quite big), the other one isn't (just a few bytes). If you are linking with the static one, be sure to define IRRKLANG_STATIC as preprocessor macro, either in your project settings or before including the irrklang header file. |
||||
|
That worked, thanks! |
|