错误原因:
You probably either a) include a header that includes a header that is later included, etc. ... i.e. the same header is included more than once, or b) you declare a function or static variable in multiple places with different types.
解决方法:
Code:
#ifndef HEADER_FILE_NAME #define HEADER_FILE_NAME stuff goes here #endif
also globals must be defined in one place, extern everywhere else,
e.g a globals header like this:
Code:
#ifdef MAIN_C (put #define MAIN_C in your main.c file) int master_count; #else extern int master_count; #endif
I usually put all my globals in one struct, so as I refer to them, like global.name to make it clear in the code