mach-o linker error when trying to use ASIHTTP - ios

I'm trying to use ASIHTTP in my app.
I had some probelms importing and linking everything right, but I found all the answers here except one.
I get a "Apple mach-o linker error" for many items, all referenced from a ASIWebPageRequest class methods in a file called "ASIWebPageRequest.o".
I don't really know where to find this file and how to fix this issue,
Anyone has a clue?
Thanks,
Yonathan
Edit - Fixed it by adding libxml2.dylib to my project, for some reason it is not included in http://allseeing-i.com/ASIHTTPRequest/Setup-instructions. I just compared the frameworks included in ASIHTTPRequest demo projects to mine and found out it was missing.

Fixed it by adding libxml2.dylib to my project, for some reason it is not included in http://allseeing-i.com/ASIHTTPRequest/Setup-instructions. I just compared the frameworks included in ASIHTTPRequest demo projects to mine and found out it was missing.

Related

Why am I receiving Apple Mach-O linker (ld) error when I use ffmpeg in iOS Xcode project?

I am getting all these errors I have no idea why I hope you can help me guys.
I have included "avformat.h" in bridging header
I have included all frameworks/libraries needed too
Make sure you have all required includes and they are included inside extern, you may be seeing name mangling going on. Read this https://trac.ffmpeg.org/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%20application
This is one possibility if you have already made sure that libraries are in path and included.

Resolving Apple Mach-O Linker Error in swift and xcode 6.4 beta

My main.storyboard got accidentally deleted and when I re-added it to my project from the trash, I started receiving 27 Apple Mach-O Linker Errors. I think that it has something to do with my Parse/Stripe integration however I wasn't getting any of these problems prior to the deletion of my storyboard. If anyone could tell me how to love this or where I should look. I am not getting any compile error in any of my self-made classes. Furthermore, when building my project, before the errors are found I get 4 Apple Mach-O Linker Warnings which say that some directory isn't found. Many thanks
You might have to import your libraries inside to make sure it's all being referenced properly ie #import "header.h". Aside from that maybe make sure the O-linker has necessary -frameworks. Hope it's some help.

how to link libcommonCrypto.dylib in project.?

I know this has been asked before but the answers at those questions don't address my solution. thats why i have to post a new question.
the problem is
previously I have linked libcommonCrypto.dylib
and built the project
the error was
ld: cannot link directly with /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system/libcommonCrypto.dylib.
Link against the umbrella framework 'System.framework' instead. for architecture armv7
after searching over the google
tried the following solutions
added libz.dylib
added SystemConfiguration.framwork
imported
it was stated at one place that i should add JavaScriptCore.framework
but in framework list of Xcode I wasn't being able to find this framework
STill
the error remains..
Any help .. what am i doing wrong ??
I had the same problem. and don't know the exact reason why this worked..
but
try this if this help.
go to Project Target >> summary tab >> see the section- Linked Frameworks and Library >> select the two libraries (libz.dylib, libcommonCrypto.dylib) >> and hit the "-" button at the bottom of the section.
now build the project..
i think it should work now, mine did.
hope it does solves your problem.. happy coding.
Add "${SDKROOT}/usr/lib/system" to your LIBRARY_SEARCH_PATHS. The other solutions do this inadvertently. That's probably why they work, but linking against JavaScriptCore.framework (for example) isn't required. You just need to expose the system libs to your project.

Duplicate symbol error when linking multiple static libraries.

There are a fair number of related questions out there already, but I'm just not getting this resolved. I'm building an application that includes two separate static libraries: RestKit and another that's on NDA. When I build, I'm getting a Apple Mach-O linker error as follows:
duplicate symbol _NewBase64Decode
in /Users/geraldwburke/Desktop/iOS Programming/MyApp/someLib.a(NSData+Base64.o)
and /Users/geraldwburke/Library/Developer/Xcode/DerivedData/MyAppddlwzdeskfwaxyargomvfhurvxzi/Build/Products/Debug-iphoneos/libRestKit.a(NSData+Base64.o)
for architecture armv7
Now, I've seen some potential fixes out there. This article seemed promising. I also tried to add a build rule using the script from this blog entry. I've tried adding and removing -ObjC, -all_load, and -force_load linker flags. No matter what I have tried, I still get that same error. Does anyone have any idea how to fix this?
BTW I will delete my identical post. Posted it on the wrong acct.
The easiest solution is to modify the source code of one of those libraries to not define NewBase64Decode. RestKit is open source; I don't know if you have the source to your secret NDA library.

ignoring file ../Test/build/Debug-iphoneos/libTest.a, missing required architecture i386 in file

I have created static library and it's working fine for device but giving warning
"ignoring file ../Test/build/Debug-iphoneos/libTest.a, missing required architecture i386 in file" if I try to deploy it on simulator and hence gives error for all references of that library.
I have read about this error on SOF but not got any workaround for this. I have followed this link to create and use static library.
http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/
So please give solution for this.
Thanks in adv.
These can be quite the pain in the ass. The long and the short of it is that you need to add i386 to your architecture for your static library and rebuild it. If you are using Xcode 4, your problems get compounded even further because your library doesn't build into one nice neat little libMy.a file. You end up with 4 different files depending on your setup.
You can read this answer on Build fat static library for Simulator and Device. This helped me out more than you can imagine.
If you get that far, don't forget about your headers and linker flags. Using static libraries can be great, but they can also be a pain. Hope this helps a little.

Resources