Create and use static library on OS X

牧云@^-^@ 提交于 2019-12-04 13:10:52

OK, so, coming back after some time, here's what I did to get it working :

Step 1 : Create the Library

  • Create a New Project, using the built-in Cocoa Library template
  • Set Library type as Static.
  • Add your Classes/Functions/Whatever
  • Under Build Phases, take care of which headers are going to go Public.

Step 2 : Use the Library in a test project

  • Drag’n'drop the final .a library file into the project (doesn’t matter if you also copy it to the target directory)
  • Link against the library
  • Update the User Header Search Paths to your initial Library .a file origin (using recursion (like /the/path/to/your/library/folder/**)
  • Set Always search user paths to YES
  • Add -ObjC to Other Linker Flags, under Build Settings.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!