Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.1 Missing required architecture X86_64 in file

Tags:

ios

xcode6.1

In Xcode 6.1 , I am getting error for iPhone 6, iPhone 5s(iOS 7.1) which says

    Undefined symbols for architecture x86_64:       "_OBJC_CLASS_$_ClientAuthenticator", referenced from:       objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 linker command failed with exit code 1 

This is what I have for architecture settings perspective

  Architectures : Standard Architectures(armv7, arm64) - $(ARCHES_STANDARD)   Base SDK : Latest iOS(8.1)    Valid Architectures: arm64, armv7, armv7s    IOS Deployment Target: iOS 6.0 

Recently I updated my OS to Yosemite and Xcode from 6.0 to 6.1. I have searched on Stack Overflow for this question which refer to Xcode 5.1 and tried all the given solutions, but nothing has worked.

Update - I tried the changes as suggested in the answer, but I still keep getting the error which says "Missing required architecture X86_64" . On further investigation I found that the file ClientAuthenticator.o which is from my library is not getting built for X86_64 architecture and probably that is the issue? I am looking how it can be built for x86_64.

My new question is what is the difference between arm64 and x86_64? More of it seems like the difference between just the architecture manufacturer, but basic 64-bit architecture remains same.

like image 567
yogsma Avatar asked Oct 24 '14 17:10

yogsma


2 Answers

  • The first thing you should make sure is that your static library has all architectures. When you do a lipo -info myStaticLibrary.a on terminal - you should see armv7 armv7s i386 x86_64 arm64 architectures for your fat binary.

  • To accomplish that, I am assuming that you're making a universal binary - add the following to your architecture settings of static library project -

enter image description here

  • So, you can see that I have to manually set the Standard architectures (including 64-bit) (armv7, armv7s, arm64) of the static library project.

enter image description here

  • Alternatively, since the normal $ARCHS_STANDARD now includes 64-bit. You can also do $(ARCHS_STANDARD) and armv7s. Check lipo -info without it, and you'll figure out the missing architectures. Here's the screenshot for all architectures -

enter image description here

  • For your reference implementation (project using static library). The default settings should work fine -

    enter image description here

Update 12/03/14 Xcode 6 Standard architectures exclude armv7s.

So, armv7s is not needed? Yes. It seems that the general differences between armv7 and armv7s instruction sets are minor. So if you choose not to include armv7s, the targeted armv7 machine code still runs fine on 32 bit A6 devices, and hardly one will notice performance gap. Source

If there is a smarter way for Xcode 6.1+ (iOS 8.1 and above) - please share.

like image 159
raurora Avatar answered Sep 28 '22 04:09

raurora


If you are building a universal library and need to support the Simulator (x86_64) then build the framework for all platforms by setting Build Active Architecture Only to No. enter image description here

like image 31
David Douglas Avatar answered Sep 28 '22 04:09

David Douglas