Yes and no. It depends on how you manage symbol visibility. There is such a thing as a "private" dependency. For example:
- libA uses a patched version of libZ, and breaks ABI compat with the upstream version
- Your program links with libA and upstream libZ dynamically
If LibA links with libZ statically, and doesn't expose any internal libZ structures through its own APIs, then there's absolutely no problem. Your code will never directly interact with the internal libZ of libA.
If LibZ is exposed by LibA, or LibA dynamically links with LibZ, then you have a problem. I'm not an expert on dynamic linkers, but they're might be some platform specific workarounds you can do.
Something else I've seen before is some libraries use preprocessor macros for their namespaces. That way, you can change the namespace (and thus symbol names) at compile time. That way, you can have multiple copies of the same library coexisting, even with type safety at compile time.