GData静态库:使用-fno-objc-arc从ARC中排除文件? [英] GData static library: exclude files from ARC with -fno-objc-arc?

查看:337
本文介绍了GData静态库:使用-fno-objc-arc从ARC中排除文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题我无法解决如何解决:

I have a problem I just can not figure how to solve:

我在我的应用中使用ARC的GData静态库。 Google的说明是将图书馆的头文件链接到项目目标。

I am using the GData static library in my app that uses ARC. Google's instructions say to link the header files from the library to the project target.

问题在于,当我这样做时,由于GData库不兼容而导致编译错误使用ARC。

The problem is that when I do so I get compiler errors as the GData library is not compatible with ARC.

Google声明:


ARC兼容性

ARC Compatibility

当库源文件直接编译到使用ARC的项目中时,必须专门为库源禁用ARC。

When the library source files are compiled directly into a project that uses ARC, then ARC must be disabled specifically for the library sources.

要在Xcode 4中为源文件禁用ARC,请在Xcode中选择项目和目标。在目标Build Phases选项卡下,展开Compile Sources构建阶段,选择库源文件,然后按Enter打开编辑字段,并键入-fno-objc-arc作为这些文件的编译器标志。

To disable ARC for source files in Xcode 4, select the project and the target in Xcode. Under the target "Build Phases" tab, expand the Compile Sources build phase, select the library source files, then press Enter to open an edit field, and type -fno-objc-arc as the compiler flag for those files.

但由于我只有头文件,因此无法在应用目标中使用此标志。

But since I have only the header files I can not use this flag in the app target.

有什么建议吗?

推荐答案

我为此写了一个简单的可重复使用的标题,可以粘贴到顶部您的源文件或作为独立头文件包含在项目中:

I wrote a simple re-usable header for this that can be pasted into the top of your source file or included in the project as a standalone header file:

https://gist.github.com/1563325

这篇关于GData静态库:使用-fno-objc-arc从ARC中排除文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆