如何使用Gdata库运行项目
我使用 gdata 框架,我想使用 GDataYoutube 库创建 youtube 应用程序。我使用交叉引用项目 Gdata 制作项目,但现在我在 xcode 4 -> 中的选项出现问题产品->档案。当我构建应用程序时,出现此错误:“服务占位符编译器标志应替换为实际服务规范”
#if !DEBUG
#if GDATA_INCLUDE_nameServiceHere_SERVICE && !GDATA_SUPPRESS_INCLUDE_WARNING
#error The service placeholder compiler flag should be replaced by actual service specifications
#endif
#endif
感谢您的帮助!
I use gdata framework and I want to create youtube app with GDataYoutube library. I make project with cross-references project Gdata, but now I have a problem with option in xcode 4 -> product -> archive. When I build my app I get this error: 'The service placeholder compiler flag should be replaced by actual service specifications'
#if !DEBUG
#if GDATA_INCLUDE_nameServiceHere_SERVICE && !GDATA_SUPPRESS_INCLUDE_WARNING
#error The service placeholder compiler flag should be replaced by actual service specifications
#endif
#endif
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
gdata 是一个整体库,objective-c 版本允许您使用预处理器机制链接出您不感兴趣的服务。看起来它应该是一个方便的功能,但作者选择将其强制执行。这可能是最好的:使用它从我的二进制文件中抽出 4MB 的脂肪。
例如,假设您只想在 iOS 上使用 YouTube API,您可以打开 GData 项目,复制 libGDataTouchStaticLib.a 目标,然后添加
到 Build Settings >其他 C 标志
这可以解决您的构建问题并为您提供更精简的应用程序。奖金!
gdata is a monolithic library, and the objective-c version lets you use the preprocessor mechanism to link out the services you aren't interested in. Seems like it should be a convenience feature, but the author chose to make it mandatory. It's probably for the best: using it liposucked 4MB out of my binary.
e.g. say you want to use just the YouTube API on iOS, you'd open the GData project, duplicate libGDataTouchStaticLib.a target, then add
to Build Settings > Other C Flags
This fixes your build problem and gives you a leaner app. Bonus!
另外,如果您需要在 GData 中使用多个(或所有)模块,您应该将 require services 设置为 0
每次将其设置为 1 时,它都会等待您要使用的规范模块(在您的情况下,youtube ),所以它看起来像:
这是您应该设置这些的屏幕截图: https://i.sstatic.net/NNGqN.png
Also, if you need to use SEVERAL (or all) modules in GData, you should just set the require services at 0
Every time you set it at 1, it waits for a specification module that you want to use (in your case, youtube), so it would look something like :
Here's a screenshot of where you should set those : https://i.sstatic.net/NNGqN.png