Undefined symbols for architecture arm64

前端 未结 30 1834
南旧
南旧 2020-11-22 08:17

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods.

Undefined symbols for architecture arm64:
  \"_OBJC_CLASS_$_FBSession\", r         


        
30条回答
  •  遇见更好的自我
    2020-11-22 09:03

    The following worked for me to get GPUImage compiling without errors on Xcode 5.1 for both the 64-bit simulator and retina iPad Mini, without needing to remove arm64 from the Valid Architectures list (which defeats the purpose of owning a 64-bit device for testing 64-bit performance).

    Download the .zip folder from the GitHub page: https://github.com/BradLarson/GPUImage

    Unzip, and navigate to the 'framework' folder. From here, add and copy the 'Source' folder into your Xcode project. Ensure 'Copy items into destination group's folder' is ticked, and that 'Create groups for any added folders' is also ticked. This will copy the generic, iOS and Mac header/implementation files into your project.

    If you don't need the Mac files because you're compiling for iOS you can delete the Mac folder either before you copy the files into your project, or simply delete the group from within Xcode.

    Once you've added the Source folder to your project just use the following to begin using GPUImage's classes/methods:

    #import "Source/GPUImage.h" 
    

    A few things to point out:

    • If you get an error saying 'Cocoa' not found, you've added the Mac folder/headers into your iOS project - simply delete the Mac group/files from your project and the warning will vanish
    • If you rename the Source folder (not the group in Xcode), use that name instead of "Source/GPUImage.h" in the #import instruction. So if you rename the folder to GPUImageFiles before you add to your project, use: #import "GPUImageFiles/GPUImage.h
    • Obviously ensure arm64 is selected in the Valid Architectures list to take advantage of the A7 64-bit processor!
    • This isn't a GPUImage.framework bundle (such as if you downloaded the framework from http://www.raywenderlich.com/60968/ios-7-blur-effects-gpuimage) so it may not the correct way to use GPUImage that Brad Larson intended, but it works for my current SpriteKit project.
    • There's no need to link to frameworks/libraries etc - just import the header and implementation source folder as described above

    Hope the above helps - it seems there were no clear instructions anywhere despite the question being asked multiple times, but fear not, GPUImage definitely works for arm64 architecture!

提交回复
热议问题