//文件1 #include "xxdata.h" void FUNC(void) { ACC8--; ACC16++; }
//文件2 #include "xxdata.h" extern void FUNC(void); void main(void) { while(1) { ACC8++; ACC16--; FUNC(); } }
//头文件xxdata.h #ifndef __xxdata_H__ #define __xxdata_H__
unsigned char ACC8; unsigned int ACC16;
#endif 编译后: *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: ACC16 MODULE: func1.obj (FUNC1) *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: ACC8 MODULE: func1.obj (FUNC1) why????????? |