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

后端 未结 3 547
星月不相逢
星月不相逢 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 10:48

    According to the ld manual, -noall_load is the default and is ignored. (If you use it, you get an error message: ld: warning: option -noall_load is obsolete and being ignored)

    Apparently the way to get -all_load to apply to only one library is as follows:

    -Wl,-force_load,somelib.a
    

提交回复
热议问题