Getting the correct /usr/libXX folder for the current binary architecture

28 views Asked by At

I am trying to find from my binary (which is supposed to be able to run on any distro), the canonical path to system libraries for a given distro / architecture.

Precisely, I am trying to load VST plug-ins which are shared objects which all distros store in folders such as /usr/lib/vst/xxx.so, /usr/lib32/vst/xxx.so, /usr/lib64/vst/xxx.so, etc.

Some distros just have /usr/lib, some have /usr/lib and /usr/lib64 be different folders with a different content entirely, some have /usr/lib symlinked to /usr/lib64... so I cannot just add all of them to my search path as that would sometimes give duplicates.

What tools can I use outside of a filesystem search which would be too slow, from a C++ program, to get the path to the folder that interests me, no matter which distro, past present or future, my users are running ?

0

There are 0 answers