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

Saturday, February 04 2006 @ 01:22 PM GMT

Contributed by: Admin

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 

0 comments



http://www.macosxguru.net/article.php?story=20060204132230667