OSX: How do I convert a static library to a dynamic one?

后端 未结 3 549
星月不相逢
星月不相逢 2021-02-13 10:35

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

3条回答
  •  孤街浪徒
    2021-02-13 11:08

    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.

提交回复
热议问题