I've published on my blog an issue about porting dlopen() related code from GNU/Linux to MacOS X. Provided that dlopen() interface is the same in both Operating Systems, MacOS X uses a .dylib extension instead of .so Linux one. The post is here. I hope you'll find it useful.