Hello. I have read up on the behavior of that area for other reasons. But I've already started to forget :)
As I recall, readelf -d or its compatible operation were used for those searches, not ldd, so the message must mean that the wrong link was made. So it is possible that somewhere -lfoo.n or -Wl,-rpath is wrong and that is causing it to pick up a different library. So we have to work hard to correct that :) Probably :) Regards.