Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 504
Tianyi Cui Avatar asked Aug 20 '10 15:08

Tianyi Cui


People also ask

What is Dylib Mac OS X?

A file with the DYLIB file extension is a Mach-O (Mach Object) Dynamic Library file that an application references during runtime in order to perform certain functions on an as-needed basis. The format has replaced the older A. OUT file format.


1 Answers

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

like image 56
Tianyi Cui Avatar answered Sep 23 '22 18:09

Tianyi Cui