Wednesday, 5 October 2016

ldd equivalent on Mac OSX

Got back to writing some C code after nearly 12 years.  Doing some work with Kafka's C library https://github.com/edenhill/librdkafka . Wanted to see which libraries were linked to my executable. 


Did a ldd and then realised Mac OSX does not have ldd instead it has otool use it with the -L option 
- my executable file is called consumer.

anambiar@localhost ~/testbed/kafka-c$ otool -L consumer
consumer:
/usr/local/lib/librdkafka.1.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libevent-2.0.5.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

Thought i will write a note to myself and someone else who might be looking for this.