我正在运行Swift 4和Xcode 9测试版。我得到了这个错误,但我不知道如何解决它。我甚至不知道那是什么意思..
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)你知道怎么解决这个问题吗?
发布于 2017-12-04 17:55:00
在我的例子中,我调用了settings = AVCapturePhotoSettings(),我得到了这个错误。
最终,解决方案调用了一个不同的初始化器。即:
settings = AVCapturePhotoSettings(format: [AVVideoCodecKey : AVVideoCodecType.jpeg])发布于 2017-08-15 21:54:48
看起来您的项目可能没有链接到AVFoundation。在project Navigator顶部单击您的项目,选择您的目标,然后单击"Build Phases“。在"Link Binary with Libraries“阶段,单击Add按钮,从列表中选择AVFoundation,然后添加它。这应该会导致您的项目正常构建。
https://stackoverflow.com/questions/45694242
复制相似问题