Why do I keep getting an Apple Mach-O Linker Error Using the Youtube API in GDATA - iphone

Hi I keep trying to build my project, but I keep getting 4 errors.
Any help would be greatly appreciated!
I definitely added the GData code correctly, and I did add the libxml2.dylib in my build phases. & in my other linker flags I have -OBjC, -lxml2, -all_load. Thank you so much!

It looks like you're GData library is only compiling for arm7 and you might be trying to support arm6, try going into your architectures section of your GdataTouchStaticLib and add "armv6" to the release/debug targets.

Do you by any chance import VideosTableViewController.m instead of .h somewhere in your code?

Related

Using -all_load for some libraries but not for some libraries

One of the components that I use for my app demands that I use -all_load as one of its linker flags. But when I add this flag, I get an errors from another library that I use in my app. When I archive the app, I get the following errors:
Apple Mach-O Linker Error
64 duplicate symbols for architecture armv7s
What is the solution for this situation?
Just remove that flag and try without it. If still doesn't work try using --force-load per library.
Do not try to run your code with no load flag. The reason for the flag is to deal with an Apple linker problem where categories in ObjectiveC libraries do not get processed properly.
Try switching to this:
-force_load $(BUILD_PRODUCTS_DIR)/libfoo.a
EDIT: I have read but not verified that as of Xcode 4.6 this is no longer necessary.
David H's answer is basically correct but has two typos in the code sample. The linker parameters should be as follows for the library that requires the special load behavior:
-force_load $(BUILT_PRODUCTS_DIR)/libfoo.a
Note: I have encountered a similar situation in my project (using Xcode 4.6.1), but the app still wouldn't link when neither -all_load nor -force_load were specified (targeting both iOS5 and iOS6).

iPhone: How to use Tesseract

This is regarding use of Tesseract in an iPhone app. I followed the steps provided here:
http://iphone.olipion.com/cross-compilation/tesseract-ocr
Now I have 2 questions:
1) How to use this in my iPhone project (which files need to be included, methods need to be called, etc.)
2) I googled and found that I'll have to include libtesseract_api.a
but got this message:
file was built for unsupported file format which is not the architecture being linked (i386)
Please help me to understand this.
I guess you have tried to run the app in Simulator, which will support i386 architecture.
Please follow this link to make the static library.
Start here:
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
and then follow this updated guide:
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
It will help you cross compile and build a universal library that contains the arm6/arm7/i386 all in the one statically linked library so it should work on simulator and device and be suitable for AppStore distribution.
Also if you have XCode 4.3 or higher beware and read the comments about how the developer directory has changed.

which framework contain dns_open function in iOS

dns_open is found in iPhoneOS5.0 in usr/include dns.h but I get a linker error. I can't seem to find the right framework for it.
on MacOSX this is probably found in System.framework but there is apparently no System.framework in iOS SDK
I'm pretty sure it's in libresolv.dylib. Try adding that from the list of "frameworks" you get when you add one in Xcode.

HttpRiot other linker flags issue

i'm developing a game which already uses httpRiot framework to communicate with a server. Now i'm also trying to add an ad-mob library but i'm getting issues with the other linked flags, if I put the -all_load flag my ad-mob service crashes, and if I take it off HttpRiot crashes, anyone knows if there is a way to make HttpRiot work without -all_load flag?
thanks in advance.

Categories in static library for iPhone device 3.0

I have categories in my static library. Any application developer should set -ObjC flag to "Other Linker Flags" to use my static library properly. It works fine for iPhone device/iPhone Simulator 2.x and iPhone Simulator 3.0. But it crashes for iPhone device 3.0. As written in this article it is new linker bug. They suggest to use one more linker flag: -all_load. But when I add this flag, build fails too, because there are duplicate symbols.
How to use categories in static libraries for iPhone device 3.0? Any suggestions?
We ran into the same problem (under 3.0, -ObjC no longer links in categories) within the Core Plot framework. All I can say is that for us, we were able to add the -all_load option to the Other Linker Flags within the target application and that did away with the runtime errors. We didn't see any warnings for duplicate symbols.
I've filed a bug report for the linker behavior, as I'm sure others have.
Its a bug caused by trying to fix another bug with a hack.
The -all_load fix for the category bug is a total hack.
See here for more.
When you add -all_load to your other linker flags, make sure, all frameworks, the library uses are linked with your target app. Otherwise, it will fail to compile. In my case, I had a Category for MKMapView and did not bind the MapKit Framework with my target app, thus the class which the category belongs to wasn't found at build time.
I ran into the same "duplicate symbols" problem. Without the -all_load flag, we had to also include all libraries our library linked against in the app link line. Removing these from the app link line solved the issue.