Need help in instantiating abstract class
-
I have an abstract class A which contains pure virtual functions.class B derives from it publicly and B has its own functions which are not virtual.Class C derives from B and calls functions of B .C also implements functions of A.now when I am trying to instantiate C i.e creating object of C its giving error that "cannot declare variable cobj of abstract type A due to pure virtual functions".It is happening only for Linux,in Windows its working fine.Can anybody help pls?
-
I have an abstract class A which contains pure virtual functions.class B derives from it publicly and B has its own functions which are not virtual.Class C derives from B and calls functions of B .C also implements functions of A.now when I am trying to instantiate C i.e creating object of C its giving error that "cannot declare variable cobj of abstract type A due to pure virtual functions".It is happening only for Linux,in Windows its working fine.Can anybody help pls?
Did you implemented all of the virtual methods? Could you post the code? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Did you implemented all of the virtual methods? Could you post the code? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Its like Ibase.hpp ---------- class Ibase { public: virtual bool get() = 0; }; Abase.hpp --------- class Abase :public Ibase { public: bool getnumber(); } baselinux.hpp ------------- class baseLinux : public Abase { public: virtual bool get(); } driver.cpp ----------- baseLinux bL; //here showing error that i have mentioned error is coming only for linux.
-
Its like Ibase.hpp ---------- class Ibase { public: virtual bool get() = 0; }; Abase.hpp --------- class Abase :public Ibase { public: bool getnumber(); } baselinux.hpp ------------- class baseLinux : public Abase { public: virtual bool get(); } driver.cpp ----------- baseLinux bL; //here showing error that i have mentioned error is coming only for linux.
-
Its like Ibase.hpp ---------- class Ibase { public: virtual bool get() = 0; }; Abase.hpp --------- class Abase :public Ibase { public: bool getnumber(); } baselinux.hpp ------------- class baseLinux : public Abase { public: virtual bool get(); } driver.cpp ----------- baseLinux bL; //here showing error that i have mentioned error is coming only for linux.