c++ - allocating an object of abstract class type error -


hi i'm getting following error , unsure why.

class intesivis: public ofbaseapp //{ ,  public ofxmidilistener{ 

this occurs when make class inresivis inherit ofxmidilistener class , following error in main source file

int main( ){

ofsetupopengl(1920,1080, of_window);             ofrunapp( new intesivis()); // <-------- error here allocating object of type abstract 

}

this confusing have tried example in exact way , not error.

class testapp : public ofbaseapp, public ofxmidilistener {  int main(){     ofsetupopengl(640, 480, of_window);     ofrunapp(new testapp()); } 

could give me idea why i'm getting error i'm calling class in exact same way. in advance.

///----------------------------------edit intesivis.h

class intesivis: public ofbaseapp //{ ,  public ofxmidilistener{  public:     intesivis() ;      void setup();     void update();     void draw();     void exit();      void keypressed(int key);     void keyreleased(int key);      // make array of particle systems     vector<fluidbodysim> marrayfluidbodysim;      fluidbodysim        mfluidbodysim       ;   ///< simulation of fluid , rigid bodies      int                 mstatuswindow       ;   ///< identifier status window     unsigned            mframe              ;   ///< frame counter     double              mtimenow            ;   ///< current virtual time     int                 mmousebuttons[3]    ;   ///< mouse buttons pressed     bool                minitialized        ;   ///< whether application has been initialized     int                 mscenario           ;   ///< scenario being simulated  // scene stuff     ofeasycam measycam;     oflight light;  // setting shader stuff     ofshader shader;     ofxpostprocessing post;  // sound      float   * laudioout; /* outputs */     float   * raudioout;      float * laudioin; /* inputs */     float * raudioin;      int     initialbuffersize; /* buffer size */     int     samplerate;      double wave,sample,outputs[2];      maxisample piano_a1, piano_as1, piano_b1, piano_c1, piano_cs1, piano_d1, piano_ds1, piano_e1, piano_f1, piano_fs1, piano_g1, piano_gs1;      vector<maxipitchstretch<grainplayerwin>*> stretches;      maxipitchstretch<grainplayerwin> *ts, *ts2, *ts3, *ts4, *ts5;      int naverages;     float *ifftoutput;     int ifftsize;  //    // playing wav files     void audioout(float *output, int buffersize, int nchannels);      double speed, grainlength, rate;      ofxmaxifft fft;     ofxmaxifftoctaveanalyzer oct;     int current;     double pos;   } ; 

testapp.h

class testapp : public ofbaseapp, public ofxmidilistener {  public:      void setup();     void draw();     void exit();      void keypressed(int key);     void keyreleased(int key);      void mousemoved(int x, int y );     void mousedragged(int x, int y, int button);     void mousepressed(int x, int y, int button);     void mousereleased();       stringstream text;      vector<particlesystem> ps;      //----------------------sound---------------------------      void newmidimessage(ofxmidimessage& eventargs);       ofxmidiin midiin;     ofxmidiout midiout;     ofxmidimessage midimessage;      void audioout(float *output, int buffersize, int nchannnels);  }; 

//----------------virtual function vorticitydistribution.h

class ivorticitydistribution {     public:         virtual vec3 getdomainsize( void ) const = 0 ;         virtual void assignvorticity( vec3 & vorticity , const vec3 & position , const vec3 & vcenter ) const = 0 ; } ;  class jetring : public ivorticitydistribution {     public:         /*! \brief initialize parameters vortex ring (using different formula other).              vorticity profile resulting such induced velocity in [0,1].              \param fradiusslug - radius of central region velocity constant              \param fthickness - thickness of vortex ring, i.e. radius of annular core              \param vdirection - vector of ring axis, vector of propagation              \param fspeed   - speed of slug          */         jetring( const float & fradiusslug , const float & fthickness , const vec3 & vdirection )             : mradiusslug( fradiusslug )             , mthickness( fthickness )             , mradiusouter( mradiusslug + mthickness )             , mdirection( vdirection )         {         }          virtual vec3 getdomainsize( void ) const         {             const float boxsidelength   = 2.f * ( mradiusouter ) ;    // length of side of virtual cube             return vec3( 1.0f , 1.0f , 1.0f ) * boxsidelength ;         }          virtual void assignvorticity( vec3 & vorticity , const vec3 & position , const vec3 & vcenter ) const         {  } ; 

this how things works:

class base {         public:          const std::string sayhi() { return "hi"; } // normal non-virtual method                      virtual std::string getname() { return ("base"); } // normal virtual method          virtual int getvalue() = 0; // pure virtual method };  

when declare testapp class testapp : public base { ... };:

normal non-virtual methods inherited declared inside base, , immutable.

normal virtual methods inherited declared inside base, can use them >as declared, or redefine them fit particular purpose.

pure virtual methods not defined, parent class "if inherit me have implement yourself, strictly matching prototype (how defined them)

if don't follow rules, you'll errors.


now, have sure there no pure virtual methodes inside ofbaseapp neither ofxmidilistener not implemented children class.

since state class testapp doesnt error, must have pure virtual methods in intesivis parents classes forgot implement.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -