10

How to clear this error. Please help me, I don't know about socket process

Undefined symbols for architecture i386: "_utf8_nextCharSafeBody", referenced from: _validate_dispatch_data_partial_string in SRWebSocket.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

JoPrithivi
  • 117
  • 1
  • 5
  • possible duplicate of [Apple Mach-O Linker Errors (20) - Undefined symbols for architecture armv7](http://stackoverflow.com/questions/9931510/apple-mach-o-linker-errors-20-undefined-symbols-for-architecture-armv7) – Paul R Jun 17 '14 at 12:55
  • Question specifies i386 not armv7. – Max MacLeod Jun 17 '14 at 13:00
  • @MaxMacLeod: true, but the answer is equally valid - it's just a missing framework (library). – Paul R Jun 17 '14 at 13:53

3 Answers3

61

I added this framework and it seems to solve my problem

  • libicucore.dylib
Kiddo
  • 5,052
  • 6
  • 47
  • 69
9

Add this framework: libicucore.dylib,CFNetwork.framework .

If not solved then Try to import the library that a used in the SRWebSocket class. and then fallow this steps to clean Product > Clean Product > Build . and then build the project.

Velmurugan S
  • 619
  • 3
  • 21
0

It's nothing to do with sockets. The target binary you are building cannot be linked because it's missing a binary for the i386 architecture. Basically, you may have a .o file for that symbol - _utf8_nextCharSafeBody - for armv, but you don't have a .o object file binary for the simulator (i386). Check the supported architectures in your static library dependency and add i386.

It's worth reading up on the basics of building in Xcode, specifically compilation and linkage phases.

Max MacLeod
  • 26,115
  • 13
  • 104
  • 132
  • 1
    Thanks Friend Max MacLeod – JoPrithivi Jun 19 '14 at 09:30
  • 1
    Like the comment underneath said - it's a missing system library. libicucore.dylib and he would have gotten the same error trying to build on a device. – Liviu R Oct 15 '15 at 18:16
  • Not true because the device is armv not Intel i386 architecture. A sim build on an Intel machine will not try to link arm binaries. – Max MacLeod Oct 15 '15 at 18:20
  • Liviu R is correct had the same problem but it got resolved after adding the missing system library. PS: I had built and compiled the library following the exact procedure mentioned. – saurabh_s Mar 15 '17 at 08:32