views:

230

answers:

2

I'm working with an existing project that produces a dynamic library (Cocoa API).

I'd rather generate a static library, but if I change the [Linking|Mach-O Type] field from "Dynamic Library" to "Static Library", both the Clean Project and Build Project complain that the target has an invalid MACH_O_TYPE value of 'staticlib'.

Is there a straightforward way to get the build to produce a static .a file?

Thanks,
Eric

+1  A: 

I ended up creating a new 'static library' project, and then added all the members. Closing xcode and bringing up the two project files in a text editor let me quickly complete the new project.

Eric
Unfortunately that's the correct solution. There's currently no way to convert a target from one target type to another.
cdespinosa
A: 

Opens up the project.pbxproj file in YourProjectName.xcodeproj folder using TextEdit, search for productType and change it's value from "com.apple.product-dynamic" to "com.apple.product-static"

Ricky Lung