Generating a static library

I want to know the step by step process of creating a static library (.a file) so that it could be exposed to other projects. This is how I am doing it right now:

  • Right click on "Targets" --> Add --> New Target.
  • Choose "Static Library" --> Next --> Gave some name & Finish
  • Added build dependencies
  • Dragged the header file to be exposed for other projects to "Copy headers"
  • Dragged and dropped all the files to be compiled under "Compile Sources"
  • Dragged and dropped the libraries in "Link Binary With Libraries".
  • What is next? How to get the .a file after this and if there is a script from where do I need to run it?


    Step by step instructions that may help you:

    http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html

    http://kyleroucis.com/Kyle_Roucis/Blog/Entries/2009/10/7_Custom_Embedded_Static_Library_for_iPhone.html


    If you are using XCode 4 this is fairly easy:

  • File > New > New Project
  • Framework & Library > Cocoa Touch Static Library
  • The rest is just personal preferences. Once you are finished (and have build your library) the '.a' file can be accessed under the 'Products' (use show in finder).

    链接地址: http://www.djcxy.com/p/76410.html

    上一篇: 如何在Xcode 4中使用dylib文件创建工作框架

    下一篇: 生成一个静态库