Take the 2-minute tour ×

Having trouble creating a static library in XCode4. I have been following this helpful tutorial:

But I keep running into the same problem. How do you create a library from an existing project? I'm having difficulty building the project (not running) because it seems to run into compiler errors within the code I just imported.

How do I set up an existing project for importing into a Cocoa Touch Static Library project?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Target-> Build Settings
In the Linking Section Change the Mach-O Type to Static Library

enter image description here

You Can Try this for making your static library usage smart

share|improve this answer
Curious, when I open an existing project and do just above (not the link) I get a compiler error as such; are the steps in the link necessary?: Check dependencies Application target has invalid MACH_O_TYPE value of 'staticlib'. –  mondousage May 30 '12 at 15:58
Steps in the links are not necessary. But you have to add all static Library header files into the project then only you can use the static library inside you project. An alternative is way is prescribed in that link –  muthukumar May 31 '12 at 7:53
add comment

Your Answer


