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)

3

3 Answers 3

61

I added this framework and it seems to solve my problem

  • libicucore.dylib
1
  • 14
    In xcode 7 ios 9.2 (there is no libicucore.dylib available), linking libicucore.tbd works instead! Feb 22, 2016 at 18:08
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.

3
  • Thanks friend. but aleady i have added this all framework... but it not working.
    – JoPrithivi
    Jun 19, 2014 at 9:30
  • 1
    This worked for me after cleaning derived data as well.
    – JaredH
    May 29, 2015 at 21:47
  • I'm using MQTTClient and got the same error. Adding libicucore.tbd works for me. Thanks.
    – Evi Song
    Apr 21, 2017 at 14: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.

4
  • 1
    Thanks Friend Max MacLeod
    – JoPrithivi
    Jun 19, 2014 at 9: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, 2015 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. Oct 15, 2015 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, 2017 at 8:32

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.