I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:
I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that
example.so is in fact a symbolic link to
.2 is the latest version. How then does an application depending on an older version of
example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?
I suspect this is related to
ldconfig but I'm not sure how.