I want to work with some frameworks like glew
and cg
so i manually added
the needed frameworks to my project by right clicking the project ->
In my case, the external framework had been downloaded with Windows and added to the project. Then it was transferred to OSX, where the Xcode project was built and the external framework didn't load properly. I guess it is because Windows changes the framework folder to be a regular folder, which OSX then has trouble with.
Solution for me was to simply download the framework with OSX and drag it into the framework folder in the XCode project.
In my case I have added Framework Search Paths
for Target, but it should be added to Project
Also Always Search Users Path
should be yes
For those whose autocomplete fails after adding framework.
I used to add frameworks, by going to Build Phases
and taking the Link Binary with Libraries
option. Now in XCode 6.1, though project was building fine, autocomplete in XCode was not working.
So what needs to be done is:
Project Navigator
and also from Link Binary with Libraries
.File
-> Add Files to
option in XCode.And auto complete will start working.
Before starting, remove the framework and all files you have added while trying to make it work.
Then, you have to add the frameworks in the Build Phases
of your target. Then go into Link Binary With Libraries
and select your framework from there.
This should do it. Your headers should be available as auto-completion after each #import directive.
If it does not work (it sometimes happens), there are additional steps I can provide to you.
Additional steps:
Go to your project settings, in the build settings:
Framework Search Paths
with the path of your frameworkUser Header Search Path
Then, it should work. If it does not, you will need to add the full path of your header in the #import
directive. Example:
#import "/path/to/my/header.h"
Apple's documentation available here states:
In my case I had to update a framework version, so I just replaced the .framework in the filesystem and then I got the error you've mentioned in the question.
Removing the framework and adding it back again, playing with the search paths and all the other suggestions didn't help.
Eventually, cleaning the build folder did the trick:
Select "Product" from the xcode menu, hold the option key and click on: "Clean Build Folder".
After that I built and ran the project successfully.