Search code examples
iosasyncsocket

How to fix this error ("_OBJC_CLASS_$_AsyncSocket", referenced from:)


When I added AsyncSocket.hand .mto my project I got this error

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

How to fix that ?


Solution

  • 2 steps to fix the problem :

    1. Add CFNetwork.framework to the project

    2. Select AsyncSocket.m from Xcode navigator (left side) and from inspector (right side) mark your project NAME under Target Membership section

    or go to Build Phases > Link Binary With Libraries > click (+) > add AsyncSocket.m