Instantiating A Class

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
schaf218
Posts: 7
Joined: Wed Aug 03, 2011 12:03 pm
Location: University of Nevada, Reno

Instantiating A Class

Post by schaf218 » Wed Jan 16, 2013 11:10 am

Hello,

I wrote a new NDmaterial that implements all of the pure virtual functions but when I attempt to compile it into a DLL using Visual Studio 2010 it continues to give me the below error:

error C2259: Cannot instantiate abstract class

Below is my header file; is there something I am missing or is there something else that could be causing this error?

Thanks for the help in advance,

-Phil

class CoupledConcreteFiber3d: public NDMaterial
{
public:
CoupledConcreteFiber3d (int tag, UniaxialMaterial *conc, UniaxialMaterial *steel,
int SectTyp, double fc, double epsc0, double rou1, double rou2, double rho);
CoupledConcreteFiber3d (void);
~CoupledConcreteFiber3d (void);

int setTrialStrain (const Vector &strain);
int setTrialStrain (const Vector &strain, double theta);
int setTrialStrain (const Vector &strain, const Vector &rate);

double getRho(void);

const Matrix &getTangent (void);
const Matrix &getInitialTangent (void) {return this->getTangent();};

const Vector &getStress (void);
const Vector &getStrain (void);

const Vector &getCommittedStress(void);
const Vector &getCommittedStrain(void);

int commitState (void);
int revertToLastCommit (void);
int revertToStart (void);

NDMaterial *getCopy (void);
NDMaterial *getCopy (const char *type);
const char *getType (void);
int getOrder (void);

protected: (the rest...)

schaf218
Posts: 7
Joined: Wed Aug 03, 2011 12:03 pm
Location: University of Nevada, Reno

Re: Instantiating A Class

Post by schaf218 » Fri Jan 18, 2013 10:47 am

Hey Guys, I figured out why it was saying I was trying to instantiate a abstract class. The issue was in the getType. I posted the correct way to meet the pure virtual of the NDMaterial below.

const char* getType (void) const;

Hope this can help someone.

Post Reply