The gcc man page says, “Order does matter when you use several options of the same kind; for example, if you specify -L more than once, the directories are searched in the order specified.”
However, are these -L directories searched before the system directories (e.g., those that ld normally uses)?
I have the case that I have two libraries of the same name, one in a system location and another in my working directory, and I want to use mine, but cannot figure out how to verify my version is being used.
Try “ldd /bin/your/application”. E.g:
In general there are 3 options how one can specify which library to use for your binary: