I'm working on a plain X11 app.
By default, my app only requires libX11.so and the standard gcc C and math libs. The App can extend features with Xfixes, Xrender and ALSA sound system. However, these (Xfixes, Xrender and ALSA) feature are optional.
To achieve this behavior, I am using run time loading i.e., libXfixes, libXrender and libasound shall be dlopen()ed.
Hence the App can function in absence of such libraries.
Now my question:
What library names should I use when calling dlopen()?
I've observed that these differ from distro to distro.
For example, on openSUSE 11, they're named the following:
- libXfixes.so
- libXrender.so
- libasound.so
On Ubuntu, however, the names have a version number attached, like this:
- libXfixes.so.3
- libXrender.so.1
- libasound.so.2
So trying to open "libXfixes.so" would fail on Ubuntu, although the lib is obviously there.
It just has a version number attached. So how should my app handle this?
Should I let my app scan /usr/lib/ first manually to see which libs we have and then choose an appropriate one? Or does anyone have a better idea?
Thanks guys,
Andy