I am trying to build a .a static library for my iPhone project.
So, I have created a new project, and I used the template Cocoa Touch Static Library
.
Then, in XCode 4.0
, I add my .m and .h files.
i have successfully build the project, but no .a file is created In XCode
, I see .a file in Products
category but displayed in red; so it doesn't exist.
I don't understand why my build button don't create .a file, any help?
A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When you compile a program that uses a static library, all the functionality of the static library that your program uses becomes part of your executable.
To create a static library project in Visual StudioOn the menu bar, choose File > New > Project to open the Create a New Project dialog. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Library.
Static libraries are simply a collection of ordinary object files; conventionally, static libraries end with the ``. a'' suffix. This collection is created using the ar (archiver) program.
I see that you accepted the answer, but I thought I'd leave a note for future library developers. After upgrading an Xcode 3.x based static library project to 4.x, the library will not always upgrade and begin doing universal library builds. When this happens, the project build will be successful and apps linked against the target dependency will run fine, but you'll get red static library files showing in the projects you pull in. This is very annoying and the only fix I have found is to recreate the project files -- I tried auditing the build settings but was unable to figure out the confounding factors.
Hope this helps save somebody the 2 hours I just lost :-P
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With