How to find if a binary is linked against a library at runtime ?

Need to find - at runtime - if the running application has been linked against a particular library, how to ?
Need to find - at runtime - if the running application has been linked against a particular library, how to ?

by polling the _dyld_get_image_name() function until the targeted dylib is found.

#include
#include

int main (int argc, char **argv)
{

unsigned long imageIndex, imageCount = _dyld_image_count();

for( imageIndex = 0; imageIndex