17

I am trying to use XMPPFramework with an iOS5 project (ARC) under xcode 4.2.1 but I am facing this problem. Once I add CocoaAsyncSocket to my project as part of preparing my project to use XMPPFramework as in 1I get the following error.

I have seen some other people having the "Undefined symbols for architecture armv7" but I did not find yet an answer to this particular issue I have at the moment.

I have linked to the CFNetwork and marked the GCDAsyncSocket.m as non-ARC (-fno-objc-arc) but i still get the error. Any help is appreciated.

Undefined symbols for architecture armv7:
  "_SSLGetBufferedReadSize", referenced from:
      ___33-[GCDAsyncSocket flushSSLBuffers]_block_invoke_0 in GCDAsyncSocket.o
      -[GCDAsyncSocket doReadData] in GCDAsyncSocket.o
  "_SSLSetIOFuncs", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLRead", referenced from:
      -[GCDAsyncSocket flushSSLBuffers] in GCDAsyncSocket.o
      -[GCDAsyncSocket doReadData] in GCDAsyncSocket.o
  "_SSLWrite", referenced from:
      -[GCDAsyncSocket doWriteData] in GCDAsyncSocket.o
  "_SSLClose", referenced from:
      -[GCDAsyncSocket closeWithError:] in GCDAsyncSocket.o
  "_SSLCreateContext", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetEnabledCiphers", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetCertificate", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetConnection", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLHandshake", referenced from:
      -[GCDAsyncSocket ssl_continueSSLHandshake] in GCDAsyncSocket.o
  "_SSLSetProtocolVersionMax", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetPeerDomainName", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetProtocolVersionMin", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Future2020
  • 9,939
  • 1
  • 37
  • 51

1 Answers1

67

You just need to add SecurityFramework in the Frameworks. I also met this same problem.

sunmax
  • 686
  • 6
  • 2
  • 1
    It works! I am wondering it was not indicated anywhere that the security framework is also needed. Thanks for your answer. – Future2020 Apr 08 '12 at 16:15
  • 7
    Order is important: CFNetwork.framework first and then Security.framework ; it makes me 14 errors in compilation, after this fix, everything is OK. – Martin Mar 21 '13 at 16:01
  • 2
    Regarding my last comment, order in: Project > Build Phases > Link Library. – Martin Mar 21 '13 at 16:20
  • I am also encountering this issue. How do I can add SecurityFramework? – shogitai Nov 08 '21 at 10:14