Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Apr 13, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link


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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant