I'm in trouble with the Warning redefinition of struct. To explain my problem I will consider 4 files.
- Interface.c
- Parser.h
- Auth.h
- Info.h
Interface.c
#include "Auth.h"
#include "Info.h"
/* some code here */
Parser.h
struct ParsedAuthResponse {
char *name;
char *key;
};
struct ParsedInfoResponse {
char *name;
char *message;
};
void auth_parser(char* serverResponse,struct ParsedAuthResponse *response_a);
void scrobble_parser(char* serverResponse, int* scrobbleParsedparsedResponse);
void love_unlove_parser(char* serverResponse, int* loveUnloveParsedResponse);
void getInfo_parser(char* serverResponse,struct ParsedInfoResponse *responseP);
Auth.h
#include "parser.h"
functionX(int a, struct ParsedAuthResponse *response);
/* some code here */
Info.h
#include "parser.h"
functionY(int a, struct ParsedInfoResponse *response);
/* some code here */
When I don't include Info.h or Auth.h in Interface.c there is no problem.