Following question http://stackoverflow.com/questions/3839756/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. Thus the usual line works fine in most cases.
gcc app.o -lmy -o app
What is the command line to link app
that should use version 1 of the library?