I have 2 header files that have to include one other.
config.h:
#ifndef CONFIG
#define CONFIG
#include "debug.h"
typedef struct Config_t {
/* some stuff */
} Config;
#endif
debug.h
#ifndef DEBUG
#define DEBUG
#include "config.h"
void somePrintingFunction(Config* conf);
#endif
Here is the error I get:
debug.h: error: unknown type name 'Config'
config.c: warning: implicit declaration of function 'somePrintingFunction'
debug.h: error: unknown type name 'Config'
I guess it's looping in the header declaration?
Edit:
Fixed in merging both files so simplify project design. If you want a real fix check in comments.