Compiling problem with openal (and caudio too)

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
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Compiling problem with openal (and caudio too)

Post by Nyx Erebos »

I tried all day to build the dynamic library for openal to use it with the exmaples but with no success, so I went through a regular installation (apt-get install) and I still can't build the examples. With that command line : gcc -o test alreverb.c -lopenal
I get errors like these :

Code: Select all

 
In file included from alreverb.c:42:0:
common/alhelpers.h:29:48: erreur: unknown type name ‘LPALISBUFFERFORMATSUPPORTEDSOFT’
alreverb.c:46:1: erreur: unknown type name ‘LPALBUFFERSAMPLESSOFT’
alreverb.c:103:9: note: expected ‘ALfloat *’ but argument is of type ‘const float *’
 
Basically I just want to compile the examples if someone knows what I'm doing wrong.

After the "getting mad" time I found the caudio wrapper and tried to build it as explained :

Code: Select all

 cmake ../ -DCAUDIO_DEPENDENCIES_DIR=../Dependencies/
Everything is okay and then :

Code: Select all

 make -j4
It goes through the whole library compilation and then stops when it comes to build the examples (damn examples :lol: )

Code: Select all

 
../../cAudio/libcAudio.so: error: undefined reference to 'pthread_mutexattr_init'
../../cAudio/libcAudio.so: error: undefined reference to 'pthread_mutexattr_settype'
../../cAudio/libcAudio.so: error: undefined reference to 'pthread_mutexattr_destroy'
../../cAudio/libcAudio.so: error: undefined reference to 'dlerror'
../../cAudio/libcAudio.so: error: undefined reference to 'dlclose'
../../cAudio/libcAudio.so: error: undefined reference to 'dlopen'
../../cAudio/libcAudio.so: error: undefined reference to 'dlsym'
../../cAudio/libcAudio.so: error: undefined reference to 'pthread_join'
../../cAudio/libcAudio.so: error: undefined reference to 'pthread_create'
 
It looks like it needs the pthread lib but I don't really know where to add it (and it seems weird that a needed lib is not set in the cmakelists.

It would spare me a lot of pain if someone knew what (certainly stupid) mistakes I'm doing.

edit : btw I'm on ubuntu 12.04 lts
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Compiling problem with openal (and caudio too)

Post by mongoose7 »

Did you ./configure? It looks as if you are not compiling for the correct platform for the compile error. I don't think you can *ever* just type gcc without -I and maybe -D. Very optimistic!

For the linker error, the code would appear to be multithreaded (pthread*) and would seem to be trying to access a .so file (dl*). You can fix these but I really think ./configure is you friend.
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Compiling problem with openal (and caudio too)

Post by Nyx Erebos »

There is no configure script and I don't see why I'd need to configure or tell where to get the library because I installed openal with apt-get.

For caudio I just had to think a little and add the dl and pthread lib in the right cmakelists (which is weird to me since it's needed to make the wrapper work), so now I can run the examples.

I think I'll stick to caudio for now but if someone knows how to run the openal example I'd like to know.
Post Reply