unknown option character `f' in: -fno-objc-arc

↘锁芯ラ 提交于 2019-12-23 15:29:49

问题


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.

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.

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.

Edit:

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.


回答1:


add a static lib named libarclite_iphoneos.a to your project. This issue almost killed me.

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

(assuming /Developer is where your ARC compatible dev tools are) This will let you run the binary on iOS 4 without having errors like

Symbol not found: _objc_autoreleasePoolPush

or others."



来源:https://stackoverflow.com/questions/10264379/unknown-option-character-f-in-fno-objc-arc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!