how to implement facebook in my application for iPhone - iphone

I have complete code for implemention for facebook in my application But the problem arises as follow :
Firstly whenever i import FBConnect\FBConnect.h the error will show that it doesn't "NO such file or direectory"
secondly due to this error i have 182 error in my application..
Thanks

You need to tell the compiler where to find the header files; in XCode, this is called "Header Search Path". You will also have linker errors later if the libraries aren't accessible.

Find "Header Search Paths" in build settings. Enter full path of the facebook sdk src folder(upto the folder-facebook-iphone-sdk/src) there.
This is assuming you have copied the reference of the FBConnect folder in your project and not the files themselves.
I tried by copying the files directly, but couldn't do so. Following the facebook developer wiki word by word would solve your problem.

Take care to see that your file name is correct..if so then check it out that that the file is present in the correct directory..

Related

Setting up facebook login in swift

I have been trying to setup an facebook login in my app.
In the guide I'm following from facebook, it says I need to import this:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
I have downloaded the IOS SDK folder which I took the Corekit folder and dragged it into my project in xcode, however when I create a objective c file and insert the line, it says:
"FBSDKCoreKit/FBSDKCoreKit.h file not found."
Did you check the "copy items if needed" checkbox ?
If you didn't you have to add framework search path in your project settings
First of all it is better to include header files to the bridging header and then use method by swift way (https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).
Then I would prefer to install FB through cocoapods.
If you insist on your solution then check Header Serch Paths in project > Build Settings > Search Paths > Header Search Paths.

Static Library path nightmare from hell

This is the point. I have a subproject (static library) created. The library compiles well. No errors. When I include this library inside a project and imports a header from that library on the project the library fails to compile because it cannot find a path that belongs to itself.
After following a bunch of tutorials on the web on how to create a static library and embed that in a project, I don't know which one is the correct one, because I have tried all and all failed and some differ.
This is how the library is set:
STATIC LIBRARY
BUILD SETTINGS:
Public header folder path = $(BUILT_PRODUCTS_DIR)
Header search path = $(SRCROOT) (recursive)
BUILD PHASES
COPY FILES = 1 file, myLibrary.h that is basically empty (created by xcode when I used the static library template to start the library.
no ADD COPY HEADERS phase
MAIN PROJECT
BUILD SETTINGS
Header search path = empty
User header search path = $(BUILT_PRODUCTS_DIR) (recursive)
Always search user paths = YES
BUILD PHASES
Yes, myLibrary.a is on target dependencies
What amazes me is that the library compiles fine alone but when put inside a project, is unable to find a header that belongs to the own library.
NOTE: I have also tried to create a copy headers phase on the library making public all .h on that library, but it failed too.
This is an example of one error:
/Users/mike/Library/Developer/Xcode/DerivedData/MyApp-dnaimaovscreasadhmvgttwjnabc/Build/Products/Debug-iphoneos/include/myLibrary/ccTypes.h:39:9:
fatal error: 'Platforms/CCGL.h' file not found
#import "Platforms/CCGL.h"
I have lost two days trying to solve this nightmare.
any thoughts?
I have uploaded a sample project to here and here
After downloading your sample project, I had it working in a few minutes by making the following changes.
First, you need to add an entry for the MyProject target's Build Settings under Header Search Paths, so that the files such as HelloWorldLayer.h, which #import "cocos2d.h", know where to find that file.
Under the Header Search Paths, I entered ../MyStaticLibrary/MyStaticLibrary/libs/** like shown in the image below:
That solved the problem of the inability of the preprocessor to find the necessary source files from the MyStaticLibrary, for the MyProject project, but after compiling, I got an error about missing symbols. I needed to add the built libMyStaticLibrary.a to the Link Binary With Libraries step like shown in the image below:
After that, the project compiles fine.
(Not enough rep to post comment...)
Did you try specifically including the Platforms directory in the header search path? Presumably, Platforms is in the source directory, not in $(BUILT_PRODUCTS_DIR) so may not be searched in your current setting.
Regarding script to show you env variables, here's how I do it (open images at the new tab for better scaling):
Added dummy shell script
Observed its output at Log Navigator
As you can see, BUILT_PRODUCTS_DIR doesn't have any headers copied from the library. Either put headers there manually (strongly not recommended) or add search path to the location that you know the headers must be at:
Now as there were two headers cocos2d.h and MyStaticLibrary.h, cocos2d.h was successfully imported although it will have additional dependency.
The path ../MyStaticLibrary/build/$(BUILD_STYLE)-$(PLATFORM_NAME) will also (recursively) have public headers of the library.
After almost 5 days of a nightmare trying to solve that, I finally found this tutorial: http://www.youtube.com/watch?v=XUhLETxgcoE
This is the only solution that worked for me. The simplest and the best.
Thanks for every one trying to solve this.
Please try this…
step1: right click on the 'projectName.xcodeproj'(static library).Choose 'Get info' and copy the full path from(General->where)
step2: Paste full path to 'Header search paths' for your main project(Both Targets and Project )

unable to use Libxml on iPhone

im trying to use libxml2.2 to parse an XML file in my iPhone app but I'm having problems. i keep getting errors like "error: libxml/tree.h: No such file or directory". after doing some searching on here and on the internet in general i found that you need to add "/usr/include/libxml2" to the Header Search Paths. i have done this and i'm still having the same problem. anybody have any idea what is going on?
also the exact same code works just fine on a coworker's computer but not on mine.
Did you add "usr/include/libxml2" or "/usr/include/libxml2" (there's a forward slash at the beginning of the path)
Also don't forget to add -lxml2 to Other Linker Flags

problem with connection of facebook in my app for iPhone

I have complete code of facebook connection. But When i dragged the complete code into my application then 112 errors will occurs. wherever i have use use that code "FBConnect/FBConnectGlobal.h"Then error will arises "FBConnect/FBConnectionGlobal.h" No such file or directory. Even i have given all the path in project setting/project active setting.
So please tell me some solution how to rectify some solution. and also tell me exact place where i have set the path and what to give in that path
Thanks
I think Ayaz is right, you checked of the "copy items.." box. However, try and start over, deleting the FBConnect folder and do it without copying it. If you start changing the headers you will probably have to do it for all the classes and if there is an update to the FBConnect library you need to start all over again.

Where are the headers for libbz2.dylib for the iPhone?

The headers for libbz2.dylib on the iPhone are missing, or contained in a less than obvious location. I've looked for bzlib.h, bz2lib.h, bz2.h, etc., grepped for patterns, and found nothing - are they included with the SDK, or do I need to just pull the header from the main libbz2 distro and use that instead?
Since the library is clearly available on the device, the header really should be in the SDK, but it appears that it isn't. I'd use the one that's packaged for the Simulator, since this is most likely to be the same as the one on the device:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/usr/include/bzlib.h
Then open a Radar case to ask that the distribution be fixed.
From the site below get the bzlib-0.5.0.0.tar.gz file and copy the files (.h and .c) inside the cbits directory to your Xcode project.
http://hackage.haskell.org/package/bzlib
So far it seems to work, I've managed to read the contents of a .bz2 file with the functions BZ2_bzReadOpen and then BZ2_bzRead.