Discovery of Dynamic library dependency on Mac OS & Linux

前端 未结 4 1581
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 22:51

On Windows there is a tool Depends.exe to discover dependency of an EXE/DLL file on other DDLs. Which commandline tool is equivalent on Mac OS and Linux?

4条回答
  •  无人及你
    2021-01-29 22:55

    You can put something like following into your bashrc so that you can always use "ldd" as interface but it will redirect macos equivalent one if machine is mac.

    # Macos equivalent of ldd
    if [[ "$OSTYPE" =~ "darwin"* ]]
    then
      alias ldd="otool -L"
    fi
    

提交回复
热议问题