|
-
October 20th, 2010, 06:15 AM
#1
Virtual and inheritance, can't find the problem
Hi, I get an "undefined reference to `vtable for controlSystem'" when compiling the following code. I can't find the problem, I thought that this compiler message appeared when you forgot to implement a virtual member, but i think it's not my case.
Thanks in advance.
Code:
class controlSystem {
protected:
byte varNumber;
byte varSize;
public:
controlSystem();
byte iBL (unsigned int value);
byte iBH (unsigned int value);
unsigned int b2I(byte bH, byte bL);
virtual unsigned int calculateOutput (unsigned int fullStatus[17]);
virtual void sensorUpdate (unsigned int lastValue[16], unsigned int newValue[16]);
virtual void saveEEPROM(unsigned int position);
virtual void initializeEEPROM(unsigned int position);
virtual void loadEEPROM(unsigned int position);
};
/*fin de control System e inicio de thresholdSystem*/
class thresholdSystem : public controlSystem {
private:
unsigned int _threshold[16];
unsigned int _valueObj[16];
boolean _isrising[16];
unsigned int _active;
protected:
public:
thresholdSystem();
void saveEEPROM (unsigned int position);
void initializeEEPROM (unsigned int position);
void loadEEPROM (unsigned int position);
unsigned int calculateOutput (unsigned int [17]);
void sensorUpdate (unsigned int [16], unsigned int [16]);
};
---------------------------
byte controlSystem::iBL (unsigned int value) {
...
}
byte controlSystem::iBH (unsigned int value) {
...
}
unsigned int controlSystem::b2I(byte bH, byte bL) {
...
}
controlSystem::controlSystem () {
int a=0;
}
thresholdSystem::thresholdSystem () {
...
}
//Cambiar código para coger dirección por parámetro
void thresholdSystem::loadEEPROM (unsigned int position) {
...
}
void thresholdSystem::saveEEPROM (unsigned int position) {
...
}
void thresholdSystem::initializeEEPROM (unsigned int position) {
...
}
unsigned int thresholdSystem::calculateOutput (unsigned int fullStatus[17]) {
...
}
void thresholdSystem::sensorUpdate (unsigned int lastValue[16], unsigned int newValue[16]){
...
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|