当前位置: 首页 > 面试题库 >

Apple Mach-O Linker (ld) Error Group with Swift 3 & Xcode 9 GM

巫马玉堂
2023-03-14
问题内容

This was running fine till GM Xcode (and iOS 11). Now I get these errors:

Apple Mach-O Linker (ld) Error Group
  "__T0So20AVCapturePhotoOutputC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from:
xxxxxxxxxx

"__T012AVFoundation37_AVCapturePhotoOutputSwiftNativeTypesPAAE012availableRawc11PixelFormatG0SaySo8NSNumberCGfg", referenced from:
xxxxxxxxx

"  "__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from:
xxxxxxxxxx

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Some of the lines it’s pointing at are:

photoSettings = AVCapturePhotoSettings(rawPixelFormatType: OSType(self.photoOutput.availableRawPhotoPixelFormatTypes.first!))
photoSettings.previewPhotoFormat = [kCVPixelBufferPixelFormatTypeKey as String: photoSettings.availablePreviewPhotoPixelFormatTypes.first!.uint32Value,
                                                kCVPixelBufferWidthKey as String: 3024, kCVPixelBufferHeightKey as String: 3024]

Also:

let rawFormat = self.photoOutput.availableRawPhotoPixelFormatTypes.first!.uint32Value
photoSettings = AVCapturePhotoSettings(rawPixelFormatType: OSType(rawFormat),
                            processedFormat: [AVVideoCodecKey : AVVideoCodecJPEG,
                                              AVVideoCompressionPropertiesKey : [AVVideoQualityKey : 1.0]] as [String : Any])
            photoSettings.previewPhotoFormat = [kCVPixelBufferPixelFormatTypeKey as String: photoSettings.availablePreviewPhotoPixelFormatTypes.first!.uint32Value,
                                                kCVPixelBufferWidthKey as String: 3024,
                                                kCVPixelBufferHeightKey as String: 3024]

问题答案:

Update 15 Sept 2017:

Official response from Apple:

Our apologies. For apps using Swift 3.2 or Swift 4.0, several AVFoundation
capture APIs (public extensions on external protocol) were inadvertently
marked private in Xcode 9. The following AVFoundation API are temporarily
unavailable:


  • AVCaptureDevice.Format.supportedColorSpaces

  • AVCaptureDevice.supportedFlashModes

  • AVCapturePhotoOutput.availablePhotoPixelFormatTypes

  • AVCapturePhotoOutput.availableRawPhotoPixelFormatTypes

  • AVCapturePhotoSettings.availablePreviewPhotoPixelFormatTypes

As a workaround you can use the SwiftPrivate versions of these API by
prepending each API with double underscore (__). For example, change
AVCaptureDevice.Format.supportedColorSpaces to
AVCaptureDevice.Format.__supportedColorSpaces.

I can confirm using __availablePreviewPhotoPixelFormatTypes fixes the build
errors.

E.g.

let settings = AVCapturePhotoSettings()
let previewPixelType = settings.__availablePreviewPhotoPixelFormatTypes.first!

Source: https://forums.developer.apple.com/thread/86810#259270



 类似资料:
  • 有人能帮我做这个吗? 我不知道错误是什么,也不知道我应该如何修复它。任何帮助都很感激

  • strip & ld strip 作用: 剥离符号表 xcode设置路径 TARGETS-Build Settings-Deployment-Strip Style 直接修改Strip Style并不会生效, 在它上方由Deployment PostProcessing参数决定其是否生效, 默认是在打包的时候才会执行strip 将Deployment PostProcessing设置成YES后生效

  • 我在ubuntu 12.04上安装PyiPot时遇到问题。在链接过程中,我收到错误: 即使我知道此库已安装,并且。等等。la文件位于 有人能解决这个问题吗? 下面是运行安装程序的完整返回。py构建:

  • 问题内容: 我正在尝试编译我的程序,它返回此错误: 在我的makefile文件中,我使用命令并链接到我的库,这是到我的库的另一个目录的符号链接。 是否可以添加选项以使其正常工作? 问题答案: 如果您的图书馆名称是say 并且位于路径上,请说: 然后将其链接到您的程序:

  • 问题内容: 我正在尝试使用Python 2.7安装MySQLdb。我收到的错误如下所示: 显然,它找不到Python 2.7。展望我看到: 该符号是什么意思?谁能建议对此错误采取补救措施? 问题答案: 它找不到Python库,而不是可执行文件。运行以查看Python库的位置,然后将其添加到库路径(例如,如果位于中,则要调用)。 该符号意味着该文件是一个符号链接; 表示它是可执行文件(这些文件由产生

  • 我有一个问题。我的项目无法编译。此错误总是出现: 我使用这个框架: 我从终端得到这个。 这是我的pod文件: use_frameworks! 我正在使用XCode 9.2。请帮帮我。

  • 我试图在一台新计算机上运行一个项目,但是我发现了这个错误< code > framework not found dtx profiler 。我已经阅读了这篇文章,但是我没有任何Pods.framework文件,也没有< code >链接的框架和库。我不知道该怎么办。我还尝试了< code>pod反集成安装。 PS。 我打开了.xcworkspace文件,而不是另一个 清洁安装的项目 多次删除派生