How to specify the library version to use at link time?
问题 Following question How do applications resolve to different versions of shared libraries at run time?, I wondered how to specify on the link command line which version of the library to use? Let\'s say I have libmy.so.1.0 libmy.so.1 -> libmy.so.1.0 libmy.so.2.0 libmy.so.2 -> libmy.so.2.0 libmy.so -> libmy.so.2 The usual way to specify the library to link with the executable does not show the version to use. Furthermore, it is very likely that one wants to link with the most recent version.