问题
All of a sudden Xcode threw me this error at compilation time:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Format", referenced from:
objc-class-ref in WOExerciseListViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
After doing some research, I may understand that a library I'm using is not compatible with 64 bit version. But this is very strange since I've been working with the same libraries for at least a week without having a single compilation problem during that time. The two libraries are just composed of a bunch of classes, and when I removed them from my project I got the same issue. Since I have never created libraries myself, I have no idea how I can find wether the ones I'm using are compatible with 64 bit (?) I also tried the following changes for architectures under the target panel :
- added $(ARCHS_STANDARD_INCLUDING_64_BIT) to the Architectures
- build active architecture only -> set to 'NO'
- for 'valid architectures' -> set to arm64, armv7 and armv7s
- deleted the DerivedData folder and its contents, cleaned and built again
But none of these changes work. Please, does someone have a clue on this? Thanks
回答1:
Apparently, your class "Format" is involved in the problem. Check your declaration of this class, especially if you did it inside another class you probably forgot the @implementation or something similar.
回答2:
Check if that file is included in Build Phases -> Compiled Sources
回答3:
Make sure the WOExerciseListViewController is a Target Member; that worked for me!

回答4:
Yes, I think the library you are using is not compatible with 64 bit version but you can solve the problem -
Just navigate to Build Settings>Architectures & replace $(ARCHS_STANDARD)
to $(ARCHS_STANDARD_32_BIT)
So that your xcode build your project with 32 bit supported version.
回答5:
I just had this error when I opened a (quite) old project, created in Xcode 4~ish, in Xcode 6.4. While the linked Frameworks were visible in the Project sidebar, I overlooked that there were no linked libraries in the Target Build Phases tab. Once I fixed that, it compiled fine.
回答6:
It turned out I forgot to write my @implementation
part.
回答7:
I simply wasn't linking the libraries in the "Link Binary with Libraries" section.
回答8:
I solved the same issue by going to Xcode Build Settings and in Architectures, I changed the Xcode 6.1.1 standard architecture to:-
$(ARCHS_STANDARD_32_BIT)
回答9:
I just had the exact same error, and solved it by restarting xcode.
For me the issue occurred after an svn update, the file in question was added to the projects folder, but it never appeared in xcode(9.3.1) – until I restarted it.
回答10:
Same error when I copied/pasted a class and forgot to rename it in .m file.
回答11:
I solved the problem by deleting reference to the file and adding it again in project. In my case it works.
回答12:
this setting worked for me:
- Architectures=$(ARCHS_STANDARD_32_BIT)
- Build Active Architecture Only:YES
- Valid Architectures armv6 armv7 armv7s arm64
回答13:
Delete the $(ARCHS_STANDARD)
and add the $(ARCHS_STANDARD_32_BIT)
.

来源:https://stackoverflow.com/questions/26559904/undefined-symbols-for-architecture-x86-64-on-xcode-6-1