I’m having trouble adding a static library from another Xcode project (CloudApp API) to my Xcode project. My project has two targets — a prefpane bundle, and a console application. I want to add the static library to the console application. Here’s what I’ve done so far:
- Created a new workspace
- Added the CloudApp project to my workspace
- Added the libcloud.a file to my “Link Project Binaries” list for the target binary
- Added -ObjC to the “Other Linker Flags” setting for the target binary
- Added $(BUILD_PRODUCTS_DIR) to the “User Header Search Paths” setting for the target binary
- Copied all the relevant headers from the CloudApp project into my project (without adding them to the target) so that I don’t get errors from any #import statements
- Edited the scheme for the target binary to require compiling CloudApp first
- Added relevant frameworks to the target (Cocoa, Foundation, CoreFoundation)
Doing all this worked fine when I just had a single Cocoa target (not a console application). But now I’m getting errors in the CloudApp header files I included. Basically things like this:
In CLWebItem.h:
Unknown type name 'NSImage'
Any ideas?
Create a prefix-header.pch and
#import <Cocoa/Cocoa.h>inside. Make sure to compile the prefix header in your settings.