Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Trouble compiling Hello World in VS 2012

kinger
Registered User
Quote
2015-09-01 13:29:15

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




erik
Registered User
Quote
2015-09-01 13:58:58

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)


kinger
Registered User
Quote
2015-09-01 15:22:51

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


kinger
Registered User
Quote
2015-09-01 15:39:43

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?


niko
Moderator
Quote
2015-09-01 19:45:59

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.


kinger
Registered User
Quote
2015-09-02 16:37:19

That worked, thanks!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact