二楼正解。我给解释一下吧。假设你在head.h和 xa.cpp文件中都写了这么一条语句:#define x 2编译器会报错,因为重复定义了。改正方法是在head.h 中写上#ifndef head#define head /////// #define x 新数值 ///////#endif。然后再在xa.cpp中包含head头文件就可以了