Linux + irrLicht + irrKlang: Demo doesn't compile

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lenx
Posts: 10
Joined: Sun Aug 27, 2006 6:01 pm

Linux + irrLicht + irrKlang: Demo doesn't compile

Post 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
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
lenx
Posts: 10
Joined: Sun Aug 27, 2006 6:01 pm

Post 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
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post 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.
lenx
Posts: 10
Joined: Sun Aug 27, 2006 6:01 pm

Post 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
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
Post Reply