Is it possible to link to a specific shared library with g++/cmake such that my application will not run if the exact version is not present on the target machine? Ultimately, I don't want to use any library versions I haven't directly tested with.
I've seen this question, but it doesn't handle the case of rejecting versions.
I understand that the dynamic linker does do this to some extent via the SONAME, e.g. libmylib.so.0 won't link to an application requiring libmylib.so.1. But is there a way to discriminate at higher version resolution than the SONAME supplies (e.g. only link if libmylib.so.1.5.3 is present)? Or is this just bad practice?