Xcode错误 - 架构x86_64的未定义符号?

时间:2017-08-15 13:48:20

标签: swift xcode

我正在运行Swift 4和Xcode 9 beta。我得到这个错误,我不知道如何解决它。我甚至不知道这是什么意思..

Undefined symbols for architecture x86_64:
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from:
      __T014InstagramClone26CustomCameraViewControllerC23cameraBtn_TouchUpInsideyypF in CustomCameraViewController.o
  "__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0Says6UInt32VGfg", referenced from:
      __T014InstagramClone26CustomCameraViewControllerC23cameraBtn_TouchUpInsideyypF in CustomCameraViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

知道如何解决这个问题吗?

2 个答案:

答案 0 :(得分:0)

根据我的情况,我已拨打settings = AVCapturePhotoSettings(),我收到了该错误。

最终解决方案是调用另一个初始化程序。即:

settings = AVCapturePhotoSettings(format: [AVVideoCodecKey : AVVideoCodecType.jpeg])

答案 1 :(得分:-1)

看起来你的项目可能并没有链接到AVFoundation。单击Project Navigator顶部的项目,选择目标,然后单击" Build Phases。"在" Link Binary with Libraries"阶段,单击添加按钮,从列表中选择AVFoundation,然后添加它。这应该会导致您的项目正常构建。