Hello everyone - I've been trying to add Facebook to an iPhone application, with no success. I followed all the instructions, looked up the problem on the internet, but I still can't find a solution to this.
The line
Code:
#import "FBConnect/FBConnect.h"
gives this error: "No such file or directory".
These are the steps I followed:
1) I downloaded the facebookconnect files to the "iphonedev" folder, which also contains my project folder;
->iphonedev
->->testproject
->->facebookconnect
2) I opened the xcodeproj file in the facebookconnect/src folder and copied the FBConnect group to my project (without copying the items into the destination group's folder).
3) I changed the Header Search Path in Project Settings to "../facebookconnect/src";
4) After looking on the internet, I changed the Header Search Paths again by right clicking the project in Targets and then going to "Get Info" - now the Header Search Paths in both locations are the same;
5) I made sure both times that "All Configurations" was selected;
6) I tried changing the relative path to the absolute path "/Users/fluvly/iphonedev/facebookconnect/src".
7) I tried multiple times to change the relative path to something else.
Nothing worked and I'm still getting the same error.
The FBConnect.h file just contains 5 includes:
Code:
#include "Facebook.h"
#include "FBDialog.h"
#include "FBLoginDialog.h"
#include "FBRequest.h"
#include "SBJSON.h"
I tried replacing the line
Code:
#import "FBConnect/FBConnect.h"
in testproject.h to
Code:
#include "Facebook.h"
#include "FBDialog.h"
#include "FBLoginDialog.h"
#include "FBRequest.h"
#include "SBJSON.h"
and the error magically disappears. It all works fine that way.
Even though I found a way around it, it really bothers me that it doesn't work in the "official" way. Maybe I have to change some xcode setting? Should the header search path be relative to the testproject or to the xcode folder?
If someone has any idea about why this happens, please help!
Thanks,
Flaviana