本文共 651 字,大约阅读时间需要 2 分钟。
错误原因:
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.
解决方法:
#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:#ifdef MAIN_C (put #define MAIN_C in your main.c file)int master_count;#elseextern 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
转载地址:http://utbci.baihongyu.com/