-1

以下代码行导致我的 iOS 应用程序出现编译错误

CFStreamCreatePairWithSocketToNetService(kCFAllocatorDefault, (__bridge CFNetServiceRef)netService, &readStream, &writeStream);

如果我用CFStreamCreatePairWithSocketToHost替换代码,它工作正常。

错误如下;

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

有人可以帮帮我吗?

4

1 回答 1

0

实际上解决方案是添加 CFNetwork 框架来构建阶段。我以某种方式错过了它。

于 2014-12-15T08:57:11.340 回答