Reputation: 23479
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 get the function pointer, it returns 0 and dlerror says symbol not found.
So I am wondering if there is a simple way to list the symbols that are exported from a dylib file. Any ideas would be great.
Upvotes: 160
Views: 152379
Reputation: 34517
man 1 nm
For example:
nm -gU /usr/local/Cellar/cairo/1.12.16/lib/cairo/libcairo-trace.0.dylib
Upvotes: 207
Reputation: 1171
Use Mach-OView for viewing all the Symbols in dylib
https://sourceforge.net/projects/machoview/
Upvotes: 0
Reputation: 171
Use nm -a your.dylib
It will print all the symbols including globals
Upvotes: 17