Making shared libraries on Mac OS X 10.7

02 Jun 2012

Compile with -fPIC -fno-common and link with -dynamiclib -flat_namespace and use the suffix .dyld for the library (e.g. libfoo.dyld). At least this worked under Mac OS X 10.7.4 using gcc 4.2.1. Find out more on the linker by typing man dyld.



See also: