-fno-objc-arc中的未知选项字符'f' [英] unknown option character `f' in: -fno-objc-arc
问题描述
我使用的是xcode 4.3.2,正在编译zmqobj https://github.com/jeremy-w/objc-zmq.git .该项目中包含的原始目标是针对os x的,但是我正在尝试为ios添加一个新目标.
I'm on xcode 4.3.2 and I'm compiling zmqobj https://github.com/jeremy-w/objc-zmq.git. The original targets included in the project are for os x, but I'm trying to add a new target for ios.
对于新目标,它给了我ARC投诉(因为代码是非ARC).但是,当为原始的os x目标进行编译时,它不会给我这些警告.
For the new target it's giving me ARC complaints (because the code is non-ARC). However when compiling for the original os x target it doesn't give me these warnings.
添加-fno-objc-arc给我:
Adding the -fno-objc-arc gives me:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `f' in: -fno-objc-arc
我必须将目标设置为错误,但是我不知道它有什么问题.感谢您的帮助,谢谢.
I must be setting the target wrong but I don't know what is wrong with it. Help appreciated, thank you.
我在目标->构建阶段->编译源中添加了标志.之前,对于我自己创建的项目,我已经做到了,并且可以正常工作.但是对于这个项目,它并没有意识到.
I'm adding the flag in the target->build phases->compiled sources. I have done this before for projects I created on my own and it works. But for this project it's not recognizing that.
推荐答案
将名为libarclite_iphoneos.a的静态库添加到您的项目中. 这个问题几乎使我丧命.
add a static lib named libarclite_iphoneos.a to your project. This issue almost killed me.
https://devforums.apple.com/message/605259 如果您的工程中包含使用ARC的静态库而不使用它,请将该文件添加到工程中:
https://devforums.apple.com/message/605259 "If you have a static library using ARC included in a project that does not use it, add this file to the project:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/arc/libarclite_iphoneos.a
/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/arc/libarclite_iphoneos.a
(假设/Developer是您的ARC兼容开发工具所在的位置) 这样一来,您就可以在iOS 4上运行二进制文件,而不会出现
(assuming /Developer is where your ARC compatible dev tools are) This will let you run the binary on iOS 4 without having errors like
未找到符号:_objc_autoreleasePoolPush
Symbol not found: _objc_autoreleasePoolPush
或其他."
这篇关于-fno-objc-arc中的未知选项字符'f'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!