简体   繁体   中英

Swift Apple Mach-O linker error

I converted my project from swift 3 to swift 4 and am using the latest version of xcode 9. On building, I get the following error :

Undefined symbols for architecture arm64: "__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from: __T06SpotMi8CameraVCC12capturePhotoyypF in CameraVC.o "__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0SaySo8NSNumberCGfg", referenced from: __T06SpotMi8CameraVCC12capturePhotoyypF in CameraVC.o ld: symbol(s) not found for architecture arm64 I am out of clues. Any help will be much appreciated.

Cheers!

There is a bug in XCode9. Apple inadvertendly made some functions in AVFoundation private.

Workaround:

Change availablePreviewPhotoPixelFormatTypes to __availablePreviewPhotoPixelFormatTypes in your source.

Same goes for the following:

supportedColorSpaces -> __supportedColorSpaces

supportedFlashModes -> __supportedFlashModes

availableRawPhotoPixelFormatTypes -> __availableRawPhotoPixelFormatTypes

availablePhotoPixelFormatTypes -> __availablePhotoPixelFormatTypes

Then it might compile! Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM