OSX/Building shared library

From Sidvind
Jump to: navigation, search
Code: GNU/Linux style
gcc -fPIC -shared -o foo.so foo.c
Code: OSX style
gcc -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -o foo.so foo.c
Code: OSX universal bundle
gcc -fPIC -arch ppc -arch ppc64 -arch i386 -arch x86_64 -bundle -Wl,-undefined,dynamic_lookup -o foo.so foo.c

Autohell issues[edit]

If you are using autohell with multiple -arch flags you need to disable the dependency tracker.

Code:
./configure --disable-dependency-tracking