This question shows research effort; it is useful and clear
165
Save this question.
Show activity on this post.
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.
16.3k15 gold badges89 silver badges138 bronze badges
For example:
nm -gU /usr/local/Cellar/cairo/1.12.16/lib/cairo/libcairo-trace.0.dylib
From man 1 nm:
-g Display only global (external) symbols. -U Don't display undefined symbols.
43.1k11 gold badges109 silver badges162 bronze badges
4 Comments
@MK. man 1 nm lists a lot of things one can do with nm. Again, it's an external resource one can read through to discover a solution, but not a solution itself to the requested “a simple way to list the symbols that are exported from a dylib file”. “nm -gU ….dylib” is, however.
Comments
Use Mach-OView for viewing all the Symbols in dylib
Explore related questions
See similar questions with these tags.


