Suppose I have a third party library called somelib.a on a Mac running Mountain Lion with Xcode 4.4 installed. I want to get a dynamic library out of it called somelib.dylib. An
I found out the solution to my problem:
g++ -fpic -shared -Wl,-all_load somelib.a -Wl,-noall_load -o somelib.dylib
The required arguments are -all_load and -noall_load.