添加CocoaAsyncSocket时架构armv7的未定义符号

Fut*_*020 17 xmpp objective-c ios xmppframework ios5

我试图在xcode 4.2.1下使用XMPPFramework和iOS5项目(ARC),但我遇到了这个问题.有一次,我添加CocoaAsyncSocket到我的项目的准备我的项目使用XMPPFramework如在部分1我碰到下面的错误.

我见过其他一些人有"未定义的架构armv7符号",但我目前还没有找到这个问题的答案.

我已链接到CFNetwork并将GCDAsyncSocket.m标记为非ARC(-fno-objc-arc)但我仍然收到错误.任何帮助表示赞赏.

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)
Run Code Online (Sandbox Code Playgroud)

小智 67

您只需在框架中添加SecurityFramework即可.我也遇到了同样的问题.

  • 订单很重要:首先是CFNetwork.framework,然后是Security.framework; 它使我在编译中出现14个错误,在此修复之后,一切正常. (7认同)
  • 关于我的上一条评论,请订购:项目>构建阶段>链接库. (2认同)