Google Cloud Endpoints linking iOS client issues -
this problem arises fact don't understand static libraries in ios , docs google seem little sparse.
i trying use google cloud endpoints mobile backend.
i generate .m , .h files client library. created new project(ownitapi), dragged libgtltouchstaticlib.a static library gtl.proj new project. add generated files .m , .h files project. add .m files compile sources , header files copy files. in build settings add "-objc -all_load" other linker flags item.
update: forgot mention copied headers gtl.proj ownitapi project. these include files gtlbase64.h, gtlbatchquery.h, gtlbatchresult,h, etc. think had because build failing without them.
without headers, get: error "'gtlobject.h'file not found." on import statement.
then take static library generated project , add main project target iphone app. test if api working, added app delegate
#import "ownitapi/gtlserviceownit.h" #import "ownitapi/gtlqueryownit.h" #import "ownitapi/gtlownitapibrands.h"
this inside application:didfinishlaunchingwithoptions: function
static gtlserviceownit *service = nil; if (!service) { service = [[gtlserviceownit alloc] init]; service.retryenabled = yes; [gtmhttpfetcher setloggingenabled:yes]; } gtlqueryownit *query = [gtlqueryownit queryforbrandslistwithuserid:@"venkat"]; [service executequery:query completionhandler:^(gtlserviceticket *ticket, gtlownitapibrands *object, nserror *error) { nsarray *items = [object brands];; nslog(@"%@", items); }];
when compile duplicate errors this:
duplicate symbol _objc_metaclass_$_gtlownitapibrand in: /users/vrao/library/developer/xcode/deriveddata/own_it!-ertvnctptaddricdrjyrmgemzgsh/build/products/release-iphoneos/libownitapi.a(gtlownit_sources.o)
17 errors that. , finally
clang: error: linker command failed exit code 1 (use -v see invocation)
update: in gtl project, libgtltouchstaticlib.a red after build , when right click "show in finder" greyed out. find .a file use "show in finder" "gtl.framework" , go folder find libgtltouchstaticlib.a.
i believe you're seeing issue see because you're including gtlownit_sources.m
file. can omit list of files include.
Comments
Post a Comment