allocating an object of abstract class type error

This is how things works:

class Base
{
        public:
         const std::string SayHi() { return "Hi"; } // a normal non-virtual method            
         virtual std::string GetName() { return ("Base"); } // a normal virtual method
         virtual int GetValue() = 0; // a pure virtual method
}; 

When you declare testApp like this class testApp : public Base { ... };:

normal non-virtual methods are inherited as they are declared inside Base, and are immutable.

normal virtual methods are inherited as they are declared inside Base, you can use them >as they already are declared, or redefine them to fit a particular purpose.

pure virtual methods are not defined, the parent class only say “if you inherit from me you HAVE TO implement those by yourself, strictly matching my prototype (How I defined them)

If you don’t follow those rules, you’ll get errors.


Now, you have to be sure that there is no pure virtual methodes inside ofBaseApp neither ofxMidiListener that are not implemented into the children class.

Since you state that class testApp doesnt do any error, you must have a pure virtual methods in InteSiVis from the parents classes that you forgot to implement.

Leave a Comment