Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Cocoa Touch Static Library with XCode4

When creating a Cocoa Touch Static Library with XCode4, the .a file in the Products groups appear red and building doesnt fix this. Then, when adding this project to another project in the same workspace with Build Phases/Link Binary With Libraries, the build fails at linking. Any pointers?

Edit: It looks like a problem with anything I build with XCode4, because no matter what project I build, the content of Products appears in red.

like image 845
sharvey Avatar asked Sep 27 '26 13:09

sharvey


2 Answers

I experienced the same bug in Xcode 4. Try building the project for the device. Once I did that once, the build product turned black and I could then build for the simulator or device without issues. You may also need to re-add the libraries to your dependent project.

like image 131
cduhn Avatar answered Sep 29 '26 04:09

cduhn


XCODE 4.x builds .a files in respective directory - below is description of release build for simulator and iphone

There was no modification to project settings during the output

/Users/userName/Library/Developer/Xcode/DerivedData/projectName-uniqueIdentifier/Build/Products/Release-iphoneos

/Users/userName/Library/Developer/Xcode/DerivedData/projectName-uniqueIdentifier/Build/Products/Release-iphonesimulator

replace below values -

userName = change userName to current user
projectName-uinqueIdentifier = project name followed by unique identifier
like image 20
anish Avatar answered Sep 29 '26 04:09

anish