Sample Header Ad - 728x90

How to find which shared library is missing?

9 votes
2 answers
6977 views
When I use ldd on Linux it tells me right away if something is missing, i.e.
ldd -d some_lib.so
    libexample.so => not found
    libex.2.so => not found
    libm.so.6 => /lib/libm.so.6 (0xf5860000)
    libdl.so.2 => /lib/libdl.so.2 (0xf785b000)
    libc.so.6 => /lib/libc.so.6 (0xf78a9000)
    /lib/ld-linux.so.2 (0x46b4c000)
On Mac OS there is no ldd and people recommend using otool -L, but that shows which shared libraries are expected, not weather or not they are there. Another approach would be to use dtruss, but it requires sudo, and it least in my experience the application behaves very differently when it is being dtrussed, and it fails for an entirely different reason (and before it gets to trying to load the troublesome .dylib). So if you suspect that a shared library is missing, what is the standard approach to finding which one it is on the Mac?
Asked by Maxim (213 rep)
Dec 19, 2019, 11:14 PM
Last activity: Jan 4, 2020, 05:22 PM