mlvea / google-api-objectivec-client

Automatically exported from code.google.com/p/google-api-objectivec-client
0 stars 0 forks source link

google-api-objectivec-client + gtm-http-fetcher Duplicate interface definition for class GTMHTTPUploadFetcher #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

1. Add google-api-objectivec-client and gtm-http-fetcher in one project as 
frameworks
2. Try to build

What is the expected output? What do you see instead?

error in GTLService.m:86

// If the upload fetcher class is available, it can be used for chunked uploads
//
// We locally declare some methods of the upload fetcher so we
// do not need to import the header, as some projects may not have it available
@interface GTLUploadFetcherClass : GTMBridgeFetcher

Error: Duplicate interface definition for class GTMHTTPUploadFetcher

This is because after preprocess it has

@interface GTMHTTPUploadFetcher : GTMHTTPFetcher in GTMHTTPUploadFetcher.h:45 

and

@interface GTMHTTPUploadFetcher : GTMHTTPFetcher in GTLService.m:86

To forward declare interface and some methods it should just implement some 
private category like this:

@interface GTLUploadFetcherClass  (somePrivateCatogory) in GTLService.m:86
...

Anyway it should be imported (as module) in .m to allow compiler to see forward 
declaration

So require to use 

#if GTL_USE_SESSION_FETCHER
#import "GTMSessionUploadFetcher.h"
#else
#import "GTMHTTPUploadFetcher.h"
#endif

instead of 

// If the upload fetcher class is available, it can be used for chunked uploads
//
// We locally declare some methods of the upload fetcher so we
// do not need to import the header, as some projects may not have it available
@interface GTLUploadFetcherClass : GTMBridgeFetcher
...

Original issue reported on code.google.com by serg.f...@gmail.com on 4 Mar 2015 at 2:34

Attachments: