I'm currently developing a little library of my own, which uses OpenAL (amongst others) like SFML. So when I compile my library I dynamically link against the OpenAL Soft .so file and create my own .so file, no problems.
But when I create a test program and link against only my own library, and include the headers of my own library; it doesn't work. Undefined symbols to OpenAL as well as it not finding its headers. (It works when I manually add these to the compilation settings of the test program; linking and including OpenAL).
However using SFML audio would only require you to link to the SFML modules, such as sfml-audio, and not manually adding OpenAL to the linking settings. So I assume SFML automatically links the dependencies it has when you link against it in your program, but how is this achieved? I've looked into libtool, pkg-config, ld options and whatever things google might suggest without much success.
So I thought I'd finally ask here to see how you do it, since I can seem to figure it out on my own :/