Error with iOS 5.1 when I use ASIHTTPRequest and SBJSON

I get this error:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_ASIHTTPRequest", referenced from: objc-class-ref in FirstViewController.o "_OBJC_CLASS_$_SBJsonParser", referenced from: objc-class-ref in FirstViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Note. I added basic framework graphics, system configuration, mobile base services, libz.dylib, libz.1.2.5.dylib, CF Network, UI Kit and Foundation. I searched all the forums and spent almost 4 days, but I just could not find a reason.

When I comment on my lines ASIHTTPRequest and SBJSON, it works fine. I added all the classes for ASIHTTPRequest and SBJSON and tested three times. Can anyone suggest what I'm doing wrong?

+6
source share
4 answers

I would look at the "Phase Assembly" section in your Target. In the Compilation Sources section, make sure that you see .m files for ASIHTTPRequest and for SBJson. Sometimes, when you drag external classes into a project, even if you check the box to copy files to your project, they do not fall into these compilation sources. When you drag and drop a file into Xcode, there is a checkbox to add the file to the target. If this is not checked, the file will not go to compilation sources. Delete the files and re-add them to make sure this file is checked (or you can add .m files if you want).

+10
source

To request ASIHTTP, add the following frameworks:

  • libz.1.2.5.dylib
  • Systemconfiguration
  • Uikit
  • Fund
  • Coregraphics
  • MobileCoreServices
  • CFNetworks

If you use ASIHttp classes in iOS 5 or later, you need to disable ARC for ASIHttpRequest classes in Project-> Build Phases β†’ Compile Sources using -fno-objc-arc for ASI API classes.

Hope it solves the problem.

+4
source

I had the same problem, but when I turned on the next frame work enter image description here

Now it works great. Remember to include -fno-objc-arc in the compilation source enter image description here

Best wishes.......

+3
source

For the ASIHTTPRequest error, it sounds like you did not add ASIHTTPRequest.m to your project.

(Or you added ASIHTTPRequest.m, but you forgot to mention the 4 billion errors xcode emits near ARC - see Why do my ASIHTTPRequest files show ARC errors? )

0
source

Source: https://habr.com/ru/post/912749/


All Articles