Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook.h not found

I am trying to work my way through a Facebook SDK book I got off Amazon. The coding starts with #import "Facebook/Facebook.h" And has you create a Facebook object almost immediately. I do not seem to have this file anywhere in my SDK. Is this book outdated already? It was just published last fall...

like image 363
zeeple Avatar asked Oct 09 '12 19:10

zeeple


4 Answers

The following is up to date and has been a great resource for me: Getting Started with the Facebook SDK

I use the following import for accessing the Facebook SDK:

#import <FacebookSDK/FacebookSDK.h>

It appears your environment does not have the Facebook framework. Download that here.

Update

I have found the offical Facebook answer to this. Apparently these are deprecated headers that can still be used for backwards compatability.

Note that at the bottom, if Xcode is having problems recognizing the import after you complete the steps below, restart XCode.

Add the headers by dragging the DeprecatedHeaders folder from the FacebookSDK.framework/Versions/A/DeprecatedHeaders folder into the Frameworks section of your Project Navigator.

Choose 'Create groups for any added folders' and deselect 'Copy items into destination group's folder (if needed)'. This adds the headers as a reference.

Now, open up your app delegate header file and replace the Facebook framework import with the Facebook header import.

Change:

#import <FacebookSDK/FacebookSDK.h> 

To:

 #import "Facebook.h" 

This allows you to make call to the FBDialog classes. The Facebook.h header includes the header files.

Note: If you have any problems with Xcode recognizing the Facebook.h file, just close and reopen your Xcode project.

Source

like image 104
Clayton Selby Avatar answered Nov 04 '22 18:11

Clayton Selby


Step 1: Select Blue icon vidhyasalai as shown in screenshot 1.

Step 2: Select Targets-> vidhyasalai -> build settings - > Search paths (if you can’t find search path, use search tap to search)

Step 3: select Serch paths->Framework search paths

Step 4: select and press return(enter)key

Step 5: Now remove $(PROJECT_DIR) and press return(enter) key.Now it will be empty also expand and check for debug,adhoc and release,make sure all will be empty.

Step 6: Repeat 5,6,7 of screenshot steps for this target second icon,expand and check for debug,adhoc and release,make sure all will be empty.

Step 7: Right click framework,delete and select move to trash

Step 8: Again Drag and drop attached framework in this mail you will get screen like screenshot 2, make sure “destination” as select the given radio button as per screen shot ref

Step 9:

Drag framework to the location under framework folder. Clean and build. Hope error was cleared

enter image description here

like image 25
Divya Bharathi Avatar answered Nov 04 '22 19:11

Divya Bharathi


This book is not outdated. May be you added framework as cocoapods?

Then to find this file in project you should write:

#import <Facebook-iOS-SDK/FacebookSDK/FacebookSDK.h>

Then just hold 'Command' button and press on it and you will get to it location

like image 32
Nikolay Shubenkov Avatar answered Nov 04 '22 18:11

Nikolay Shubenkov


You need to download and install the SDK and after that add the Facebokk framework to your project.

Once you're done with that part you will be able to import FacebookSDK.

heres' the link https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/

watch the video

like image 28
lionserdar Avatar answered Nov 04 '22 20:11

lionserdar