I just downloaded the OpenAL library using the command sudo apt-get install libopenal1 libopenal-dev, now I can't find where the library is on my system and how should it be linked with Eclipse. I am new to Ubuntu hence I am not familiar with how Ubuntu's file system works.

Thanks in Advance.


As far as I can tell, the libopenal-dev package installs its headers to /usr/include/AL/ so (since /usr/include is a standard search path) provided you include them as <AL/whatever.h> you should not need to do anything else.

Similarly, the library goes in /usr/lib/x86_64-linux-gnu/ (or its 32-bit equivalent) so it should just be a matter of adding openal to the list of libraries in your project settings.

FYI since the package appears to provide a .pc file, you can always run pkg-config --cflags --libs on the command line and copy the relevant flags and settings from there.

| improve this answer | |
  • I tried running a short program, but none of the functions seemed to be defined. It didn't have any trouble finding the header file, but no function works. Header files included: #include <AL/al.h> // OpenAL header files #include <AL/alc.h>, but even functions like alcOpenDevice(NULL) aren't working! – Sreram Feb 18 '16 at 16:51
  • Tried running, or tried building? Did you add the AL library in the project's C/C++ build settings? – steeldriver Feb 18 '16 at 16:55
  • So obviously, the library is not linked. If it was Windows, we just have to track down the location of .lib files, but in this case, how should I link it? and where will I find the library files and what extension are they stored with? – Sreram Feb 18 '16 at 16:55
  • Yes I tried building. It just keeps saying that the functions were undefined. – Sreram Feb 18 '16 at 16:56
  • What you seem to be asking is really an eclipse question, not an Ubuntu question: IIRC you go to Properties --> Settings --> GCC C Linker --> Libraries and add the name of the library (minus its 'lib' prefix) in the top pane e.g. for libopenal you would add 'openal'. You may need to add the library path /usr/lib/x86_64-linux-gnu/ in the bottom pane but try it without first (since that should be a built-in search path for gcc/g++) – steeldriver Feb 18 '16 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.