Adam
Adam

Reputation: 957

.framework product is red no matter what

I'm trying to add this framework to a project. I have followed these instructions to the letter:

  1. Add SocketRocket.xcodeproj as either a subproject of your app or in your workspace.
  2. Add SocketRocket.framework to the link libraries
  3. If you don't have a "copy files" step for Framework, create one
  4. Add SocketRocket.framework to the "copy files" step.

I made sure I had only one instance of xcode open, then dragged the SocketRocket.xcodeproj file into my project. I added the .framework file to the link libraries, created a copy files build phase, then added the .framework to the copy files build phase.

This is the error I get when I try to build:

clang: error: no such file or directory: '/Users/adamhickey/Library/Developer/Xcode/DerivedData/websockettest-fcuhfltporfkitgubwcjukxogzas/Build/Products/Debug-iphonesimulator/SocketRocket/SocketRocket'

It's quite right: that directory does not exist.

In build phases, the SocketRocket.framework is red under Link Binary With Libraries. It's also red in the products folder of the SocketRocket subproject.

I've been googling this error for hours and the majority of the things I've tried have pointed me towards changing the build location in Xcode->preferences-locations. I've tried:

  1. setting it to relative, picking my own, and going to advanced and choosing legacy.
  2. building for a device
  3. build for->archiving
  4. building for release

If I open the SocketRocket.xcodeproj in a separate instance of xcode and try to build it, 3 of the four products are red. The products are: libSocketRocket.a, SRWebSocketTests.octest, TestChat.app, and SocketRocket.framework. The first is white, while the last three are red.

I'm assuming that if I can get the .framework file to build in a separate project, this will solve my overall problem. However, nothing I do seems to have any effect.

Please please please help! I'm using xcode 4.6.

Upvotes: 5

Views: 2552

Answers (2)

beepscore
beepscore

Reputation: 648

I had a similar problem configuring for libSocketRocket.a.

My workspace contains two projects as siblings: SocketRocket and myProject.

I added SocketRocket as a git submodule.

Christoph's answer works for me so far:

What's the correct way to configure XCode 4 workspaces to build dependencies when needed?

Change libSocketRocket.a location from Relative to Group to Relative to Build Products.

Search for path containing built static library, e.g.:

/Users/myName/xcode-build/myProject-eegkidwlennrekbsinvncwxqybol/Build/Products/Debug-iphoneos/libSocketRocket.a

Then fix path.

Upvotes: 1

David Hoerl
David Hoerl

Reputation: 41652

In your primary project, in the build phases, create a dependency on that SocketRocket project. You should be seeing the .a show up there as well as in the link phase. If you still cannot get it to work create a small demo project that tries to link it and zip that up and put on DropBox then edit question with location.

Upvotes: 0

Related Questions