It happens because you can't define Shape::pi more than once. It's defined once when you include Shape.h in Shape.cpp, and then again every other time you use Shape.h in another cpp file. When you go to link you program together the linker will barf because of multiple definitions.