How to build a dylib from several .o in Mac OS X using gcc

Tianyi Cui picture Tianyi Cui · Aug 20, 2010 · Viewed 17.5k times · Source

I have several .o files and want to bundle them in a .dylib, how can I do that it Mac OS X using gcc? Thank you very much.

Answer

Tianyi Cui picture Tianyi Cui · Aug 20, 2010

Use g++ -dynamiclib -undefined suppress -flat_namespace *.o -o something.dylib