Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
How to link irrklang with QT Creator using QMake?

pwnstar23
Registered User
Quote
2012-10-22 23:27:13

I have the lines

INCLUDEPATH += C:\\irrKlang-1.4.0\\include

LIBS += -LC:\\irrKlang-1.4.0\\lib\\Win32-gcc -LlibirrKlang.a

this seems to find the files ok. But when I compile make reports

./debug\LeeAudio.o:C:\SkyDrive\QT_Projects\LeesSpaceShip\LeesSpaceShip-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug/../LeesSpaceShip/Code/LeeAudio.cpp:22: undefined reference to `_imp___ZN8irrklang20createIrrKlangDeviceENS_21E_SOUND_OUTPUT_DRIVEREiPKcS2_'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\LeesSpaceShip.exe] Error 1
mingw32-make: *** [debug] Error 2
16:24:24: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.


pwnstar23
Registered User
Quote
2012-10-22 23:41:24

I'm using mingw 4.4 compiler.


pwnstar23
Registered User
Quote
2012-10-23 00:58:47

gah, I got it, just needed to make
LIBS += -LC:\\irrKlang-1.4.0\\lib\\Win32-gcc -lirrKlang


Richard
Guest
Quote
2013-04-11 17:31:04

Hello,
Sorry for posting on this topic, but I did exactly what you did and compiler is finding the libraries.
My code compiles OK. However, when I write any line of code using the library, its crashing immediately.

Here is the simple code I wrote :

ISoundEngine* engine = createIrrKlangDevice();

if (!engine)
{
printf("Could not startup engine\n");
}

engine->play2D("C:/irrKlang-1.4.0/media/getout.ogg", true);

engine->drop(); // delete engine

What is weird is that it crashes immediately and is not executing the code before the code written above.

Does somebody have an idea?

Thank you very much


niko
Moderator
Quote
2013-04-11 17:56:56

Are you maybe using the latest MingW GCC compiler? This one has an incompatble ABI, there is a special build of irrKlang on the download page for it, you need to use that one.


Richard
Guest
Quote
2013-04-12 11:08:42

Hello niko,

Indeed I am using MingW GCC Compiler 4.7. I tried with your suggested files and I still have the same issue... :(
Maybe I am doing something wrong but with no logs at all, not easy to guess from where it could come ....


Richard
Guest
Quote
2013-04-12 11:52:05

Hello again,

Looks like there is improvment :
I added the lines :
LIBS += -L$$PWD/C:/irrKlang-1.4.0/lib/Win32-gcc/irrKlang.a
INCLUDEPATH += $$PWD/C:/irrKlang-1.4.0/lib/Win32-gcc
INCLUDEPATH += $$PWD/C:/irrKlang-1.4.0/bin/Win32-gcc

Now, it doesnt compile :
D:\Profiles\rPortelli\Desktop\essai\essai\main.cpp:19: erreur : undefined reference to `_imp___ZN8irrklang20createIrrKlangDeviceENS_21E_SOUND_OUTPUT_DRIVEREiPKcS2_'

I guess my .a library doesnt link with dll. Any idea how to do that on Qt Creator when pragma is not working?

Thanks !


Richard
Guest
Quote
2013-04-12 15:22:57

Finally made it work correctly ....
Directly included .a lib in .pro file :
LIBS += "path/to/executable//libirrKlang.a"

Thanks


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (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