在XCode中设置Google Cast API

时间:2014-03-18 01:58:30

标签: xcode chromecast

我按照https://developers.google.com/cast/docs/ios_sender中描述的说明操作,但是当我尝试构建项目时,我得到了36个链接器错误,如下所示:

Undefined symbols for architecture i386:
  "_SSLClose", referenced from:
      -[GCK_GCDAsyncSocket closeWithError:] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLCreateContext", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLGetBufferedReadSize", referenced from:
      ___37-[GCK_GCDAsyncSocket flushSSLBuffers]_block_invoke in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket doReadData] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLHandshake", referenced from:
      -[GCK_GCDAsyncSocket ssl_continueSSLHandshake] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLRead", referenced from:
      -[GCK_GCDAsyncSocket flushSSLBuffers] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket doReadData] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetCertificate", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetConnection", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetEnabledCiphers", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetIOFuncs", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetPeerDomainName", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetProtocolVersionMax", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLSetProtocolVersionMin", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SSLWrite", referenced from:
      -[GCK_GCDAsyncSocket doWriteData] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_SecCertificateCopyData", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecCertificateCreateWithData", referenced from:
      -[GCKDeviceAuthChannel init] in GoogleCast(GCKDeviceAuthChannel.o)
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecKeyRawVerify", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecPolicyCreateBasicX509", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecTrustCopyPublicKey", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecTrustCreateWithCertificates", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecTrustEvaluate", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecTrustGetCertificateAtIndex", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecTrustGetCertificateCount", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_SecTrustSetAnchorCertificates", referenced from:
      -[GCKDeviceAuthChannel didReceiveBinaryMessage:] in GoogleCast(GCKDeviceAuthChannel.o)
  "_kCFStreamNetworkServiceType", referenced from:
      -[GCK_GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamNetworkServiceTypeVoIP", referenced from:
      -[GCK_GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamPropertySSLPeerTrust", referenced from:
      ___33-[GCKCastSocket socketDidSecure:]_block_invoke in GoogleCast(GCKCastSocket.o)
  "_kCFStreamPropertySSLSettings", referenced from:
      -[GCK_GCDAsyncSocket cf_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLAllowsAnyRoot", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLAllowsExpiredCertificates", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLAllowsExpiredRoots", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLCertificates", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLIsServer", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLLevel", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLPeerName", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLValidatesCertificateChain", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCKCastSocket connectToHost:port:withTimeout:] in GoogleCast(GCKCastSocket.o)
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCKCastSocket connectToHost:port:withTimeout:] in GoogleCast(GCKCastSocket.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我从github下载了示例Hello,Text应用程序并且它没有错误地构建。我在这里做错了什么?

更新:根据@Rhythmic Fistman的建议,我链接了安全框架,并消除了23个链接器错误。但是,仍有13个链接器错误如下:

Undefined symbols for architecture i386:
  "_kCFStreamNetworkServiceType", referenced from:
      -[GCK_GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamNetworkServiceTypeVoIP", referenced from:
      -[GCK_GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamPropertySSLPeerTrust", referenced from:
      ___33-[GCKCastSocket socketDidSecure:]_block_invoke in GoogleCast(GCKCastSocket.o)
  "_kCFStreamPropertySSLSettings", referenced from:
      -[GCK_GCDAsyncSocket cf_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLAllowsAnyRoot", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLAllowsExpiredCertificates", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLAllowsExpiredRoots", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLCertificates", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLIsServer", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLLevel", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLPeerName", referenced from:
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
  "_kCFStreamSSLValidatesCertificateChain", referenced from:
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCKCastSocket connectToHost:port:withTimeout:] in GoogleCast(GCKCastSocket.o)
      -[GCK_GCDAsyncSocket maybeStartTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCK_GCDAsyncSocket ssl_startTLS] in GoogleCast(GCKAsyncSocketWrapper.o)
      -[GCKCastSocket connectToHost:port:withTimeout:] in GoogleCast(GCKCastSocket.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有什么想法吗?

2 个答案:

答案 0 :(得分:2)

您需要关联Security.frameworkCFNetwork.framework

Xcode>您的项目>构建阶段> Link Binary with Libraries> +> Security.framework

答案 1 :(得分:0)

转到链接器标志并添加" -ObjC"标志