很简单的一段程序,却出现如上错误,原因很简单,还是要注重细节!
01 #ifndef COLOR_H02 #define COLOR_H03 04 namespace GrabCut_DZY05 {06 class Color{07 public:08 Color();09 private:10 float r,g,b;11 } //需要有逗号12 13 }14 15 #endif
解决方法:定义类最后需要加上逗号