开发者

How to run project with Gdata library

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开发者_StackOverflow 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!


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

-DGDATA_REQUIRE_SERVICE_INCLUDES=1
-DGDATA_INCLUDE_YOUTUBE_SERVICE=1

to Build Settings > Other C Flags

This fixes your build problem and gives you a leaner app. Bonus!


Also, if you need to use SEVERAL (or all) modules in GData, you should just set the require services at 0

-DGDATA_REQUIRE_SERVICE_INCLUDES=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 :

-DGDATA_REQUIRE_SERVICE_INCLUDES=1
-DGDATA_INCLUDE_YOUTUBE_SERVICE=1

Here's a screenshot of where you should set those : http://i.imgur.com/RN7Ot.png

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜