I have the following warning during link:
/usr/bin/ld: warning: libxxx.so.6, needed by /a/b/c/libyyy.so, not found (try using -rpath or -rpath-link)
You need to add the dynamic library equivalent of
This will cause the linker to look for shared libraries in non-standard places, but only for he purpose of verifying the link is correct.
If you want the program to find the library at that location at run-time, then there's a similar option to do that:
But, if your program runs fine without this then you don't need it.