It should be more like this:
Code:
void CategoryImpl::printX(const Product &p) const
{
std::cout << getX(p) << '\n';
}
The main problem was CategoryImpl:: before getX. I also changed it to a reference (Product &) and added const. You need to ensure that previous declarations of printX look the same.