I do not understand why an error and how to solve it. (An error on invoking attributes in the constructor) 
class shader { public: shader() { attributes(); } virtual void attributes() = 0; }; class staticShader : public shader { public: staticShader() : shader() { }; void attributes() override { std::cout << "attribute"; } }; int main() { staticShader shader{}; system("pause"); return 0; }class shader { public: shader() { attributes(); } virtual void attributes() = 0; }; class staticShader : public shader { public: staticShader() : shader() { }; void attributes() override { std::cout << "attribute"; } }; int main() { staticShader shader{}; system("pause"); return 0; }