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

2019-06-27 11:23发布

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条回答
在下西门庆
2楼-- · 2019-06-27 11:26

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."

查看更多
登录 后发表回答