Page 1 of 1

Linux + irrLicht + irrKlang: Demo doesn't compile

Posted: Sat Feb 16, 2008 5:35 pm
by lenx
Hi there,
I'm trying to get irrLicht working in ubuntu. So far i can compile and run examples, but when i try to compile the demo, i get an error related to irrKlang:

CDemo.cpp:(.text+0x26b): undefined reference to `irrklang::createIrrKlangDevice(irrklang::E_SOUND_OUTPUT_DRIVER, int, char const*, char const*)'

Does someone know what i should do in this case? It's probably some kind of library thing which i should copy somewhere, but i have no clue.

FYI, i found in another thread that i should put following line in the makefile, which i did;
CPPFLAGS = -I/home/lenx/irrKlang-1.0.4/include -I../../include -I/usr/X11R6/include

This solved previous errors i had, but now that one still remains.

Thanks for helping out,
lenx

Posted: Sat Feb 16, 2008 5:54 pm
by vitek
You need to link to the IrrKlang library file for your platform. I believe that it should be named something like irrklang.a.

Travis

Posted: Sat Feb 16, 2008 6:14 pm
by lenx
The file you mention is in a win32-gcc folder so i guess it won't work. Maybe it's libIrrKlang.so in the bin folder. I added following link in my makefile but still it doesn't work :(

-I/home/lenx/irrKlang-1.0.4/bin/linux-gcc/libIrrKlang.so

Posted: Sat Feb 16, 2008 7:25 pm
by randomMesh
lenx wrote:-I/home/lenx/irrKlang-1.0.4/bin/linux-gcc/libIrrKlang.so
Try it without the '-I' since it it a precompiled shared object.

Posted: Sat Feb 16, 2008 7:37 pm
by lenx
It worked! Thank you! :lol:

I still had to add -pthread to get it working though. The full line of my makefile looks like this now (just posting for if anyone else runs into the same issue):

CPPFLAGS = -I../../include -I/usr/X11R6/include /home/lenx/irrKlang-1.0.4/bin/linux-gcc/libIrrKlang.so -pthread

Posted: Sun Feb 17, 2008 1:09 am
by vitek
Actually, if you're using gcc on linux, you should use something more like this because you only want the link settings to be on the link line.

Code: Select all

CPPFLAGS = -I/home/lenx/irrKlang-1.0.4/include -I../../include -I/usr/X11R6/include -pthread
LDFLAGS = -L/home/lenx/irrKlang-1.0.4/bin/linux-gcc -lIrrKlang
You should have been able to get the necessary information from the IrrKlang examples makefile.

Travis