How to print a list of symbols exported from a dynamic library

前端 未结 4 1311
清酒与你
清酒与你 2020-12-04 05:57

So I\'ve been trying to get dynamic libraries to work in my XCode project under Mac OS X. So far no joy.

I am able to load the dylib file, but when I call dlsym to g

相关标签:
4条回答
  • 2020-12-04 06:36

    Use Mach-OView for viewing all the Symbols in dylib

    https://sourceforge.net/projects/machoview/

    0 讨论(0)
  • 2020-12-04 06:45

    Use otool:

    otool -TV your.dylib
    

    OR

    nm -g your.dylib
    
    0 讨论(0)
  • 2020-12-04 06:49

    man 1 nm

    https://web.archive.org/web/20160316222941/https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/nm.1.html

    For example:

    nm -gU /usr/local/Cellar/cairo/1.12.16/lib/cairo/libcairo-trace.0.dylib
    
    0 讨论(0)
  • 2020-12-04 06:51

    Use nm -a your.dylib

    It will print all the symbols including globals

    0 讨论(0)
提交回复
热议问题