GData 静态库:使用 -fno-objc-arc 从 ARC 中排除文件?
我在使用 ARC 的应用程序中使用 GData 静态库。谷歌的说明说将头文件从库链接到项目目标。
问题是,当我这样做时,我会收到编译器错误,因为 GData 库与 ARC 不兼容。
谷歌声明:
ARC 兼容性
当库源文件直接编译到使用 ARC 的项目中时,必须专门针对库源禁用 ARC。
要在 Xcode 4 中对源文件禁用 ARC,请在 Xcode 中选择项目和目标。在目标“Build Phases”选项卡下,展开 Compile Sources 构建阶段,选择库源文件,然后按 Enter 打开编辑字段,然后键入
-fno-objc-arc
作为编译器标志对于这些文件。
(参考)
但是由于我只有头文件,所以我不能在应用程序目标中使用此标志。
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.
The problem is that when I do so I get compiler errors as the GData library is not compatible with ARC.
Google states that:
ARC Compatibility
When the library source files are compiled directly into a project that uses ARC, then ARC must be disabled specifically for the library sources.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,我问了一下,10 分钟后就发现了。无论如何,如果它会对某人有所帮助:
在头文件中搜索名为:GDataDefines.h 的文件
并在其中添加以下代码:
然后在导致 ARC 错误的 GDataObject.h 中将
GDataDescriptionRecord 结构更改为
并且
到
这是 google 更新的链接:
http://code.google.com/p/gdata -objectivec-client/source/detail?r=712
就是这样。
希望它能帮助别人
沙尼
Well I asked and found the unswear 10 minutes later. Any way if it will help someone:
search the header files for file named : GDataDefines.h
and add this code inside:
Then in the GDataObject.h which causes the ARC errors
Change the GDataDescriptionRecord struct to
And the
to
This is the link to google update:
http://code.google.com/p/gdata-objectivec-client/source/detail?r=712
That's it.
Hope it will help someone
Shani