最新消息:

Mac OS X 上用 otool 代替 ldd

ldd admin 6541浏览 0评论

在 Mac OS X 上使用 Linux 上经常使用的命令ldd,会有如下提示:

localhost:~ root# ldd
-sh: ldd: command not found
如果你问我<code style="margin: 0px 2px; padding: 0px 5px; border-radius: 3px; border: 1px solid #eaeaea; white-space: nowrap; background-color: #f8f8f8;">ldd</code>是干嘛的,我也不会不耐烦的。<code style="margin: 0px 2px; padding: 0px 5px; border-radius: 3px; border: 1px solid #eaeaea; white-space: nowrap; background-color: #f8f8f8;">ldd</code>就是<code style="margin: 0px 2px; padding: 0px 5px; border-radius: 3px; border: 1px solid #eaeaea; white-space: nowrap; background-color: #f8f8f8;">list dynamic dependencies</code>(我猜的)。在 Mac OS X 上使用<code style="margin: 0px 2px; padding: 0px 5px; border-radius: 3px; border: 1px solid #eaeaea; white-space: nowrap; background-color: #f8f8f8;">otool -L</code>来代替<code style="margin: 0px 2px; padding: 0px 5px; border-radius: 3px; border: 1px solid #eaeaea; white-space: nowrap; background-color: #f8f8f8;">ldd</code>很简单:
localhost:~ root# otool -L /usr/bin/svn
/usr/bin/svn:
        /usr/local/lib/libsvn_client-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_wc-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_ra-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_diff-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_ra_local-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_repos-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_fs-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_fs_fs-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_fs_util-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_ra_svn-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libsasl2.2.dylib (compatibility version 3.0.0, current version 3.15.0)
        /usr/local/lib/libsvn_delta-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/local/lib/libsvn_subr-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
        /usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 158.0.0)
        /usr/local/apr-util/lib/libaprutil-1.0.dylib (compatibility version 6.0.0, current version 6.3.0)
        /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/local/apr/lib/libapr-1.0.dylib (compatibility version 6.0.0, current version 6.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 59.0.0)
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 55471.14.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0)

转载请注明:爱开源 » Mac OS X 上用 otool 代替 ldd

您必须 登录 才能发表评论!