Okay so with g++ on OS X, you make shared libraries with -dynamiclib, not -shared.
Opine