title: Google Cloud Endpoints linking iOS client issues
body: <p>This problem arises from the fact I don't completely understand static libraries in iOS and the docs from google seem to be a little sparse. </p>
  
  <p>I am trying to use Google Cloud Endpoints for my mobile backend. </p>
  
  <p>I generate the .m and .h files for my client library. Then I created a new project(OwnItApi), dragged the libGTLTouchStaticLib.a static library from GTL.proj to this new project. Then I add the generated files .m and .h files to this project. I add all the .m files to the Compile Sources and then I the header files Copy Files. In the Build Settings I add "-ObjC -all_load" to the Other Linker Flags item.</p>
  
  <p><strong>Update:</strong> I forgot to mention that I also copied the headers from the GTL.proj to OwnItAPI project. These include files GTLBase64.h, GTLBatchQuery.h, GTLBatchResult,h, etc. I think I had to do this because the build was failing without them. </p>
  
  <p>Without the headers, I get: the error "'GTLObject.h'file not found." on the import statement.</p>
  
  <p>Then I take the static library generated from this project and add it to my main project whose target is an iphone app. To test if the API is working, I added this to App Delegate</p>
  
  <pre><code>#import "OwnItApi/GTLServiceOwnit.h"
  #import "OwnItApi/GTLQueryOwnit.h"
  #import "OwnItApi/GTLOwnitApiBrands.h"
  </code></pre>
  
  <p>This is inside the application:didFinishLaunchingWithOptions: function</p>
  
  <pre><code>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);
  }];
  </code></pre>
  
  <p>When I compile I get duplicate errors like this:</p>
  
  <pre><code>duplicate symbol _OBJC_METACLASS_$_GTLOwnitApiBrand in:
  /Users/vrao/Library/Developer/Xcode/DerivedData/Own_It!-ertvnctptaddricdrjyrmgemzgsh/Build/Products/Release-iphoneos/libOwnItApi.a(GTLOwnit_Sources.o)
  </code></pre>
  
  <p>17 errors that look just like that. and then finally</p>
  
  <pre><code>clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p><strong>Update:</strong> In GTL project, libGTLTouchStaticLib.a is red after I build it and when I right click it the "Show in Finder" is greyed out. To find the .a file I use "Show in Finder" for "GTL.framework" and then go back a folder to find libGTLTouchStaticLib.a. </p>