Under OSX build the preload library with -flat_namespace flag.
Apparently this is necessary but I haven't tested it.