将
Xcode更新为最新版本,现在尝试编译现有项目时出现奇怪的编译器错误.我认为这是一些需要改变的构建设置,但无法解决问题.
Apple LLVM Compiler 4.1 error clang: error: the clang compiler does not support '-fobjc-abi-version=0' Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang Failed with exit code 1
这是什么意思?
解决方法
从
clang manpage:
-fobjc-abi-version=version Select the Objective-C ABI version to use. Available versions are 1 (legacy "fragile" ABI),2 (non-fragile ABI 1),and 3 (non-fragile ABI 2).
The non-fragile ABI refers to the ability to add instance variables to
a class without requiring recompilation of all subclasses.I.e. in v1 (there really aren’t true versions of ObjC),if Apple were
to add an instance variable to,say,NSView (on Cocoa,32 bit),then
every subclass of NSView (or subclass of subclass) would have to be
recompiled or they would blow up. v2 and v3 fix this.