I am working on a project for school and I ran into a problem I am not sure how to solve. Here are bits of the code (not the whole classes) and the error message:
class CCPU
{
public:
CCPU ( uint8_t * memStart,
uint32_t pageTableRoot );
virtual ~CCPU ( void ) { }
virtual uint32_t GetMemLimit ( void ) const = 0;
virtual bool SetMemLimit ( uint32_t pages ) = 0;
virtual bool NewProcess ( void * processArg,
void (* entryPoint) ( CCPU *, void * ),
bool copyMem ) = 0;
bool ReadInt ( uint32_t address,
uint32_t & value );
bool WriteInt ( uint32_t address,
m_PageTableRoot;
};
This is the class that inherits from the one above:
class CProcManager : public CCPU
{
public:
CProcManager( uint8_t* memStart,uint32_t pageTableRoot ) : CCPU(memStart, pageTableRoot) {}
virtual uint32_t GetMemLimit ( void ) const;
virtual bool SetMemLimit ( uint32_t pages );
virtual bool NewProcess ( void * processArg,
void (* entryPoint) ( CCPU *, void * ),
bool copyMem );
static void InitInfoPages (uint8_t * pages_mem);
};
And this would be the code calling the constructor:
CProcManager init_ccpu((uint8_t*)mem, 32/*just a test number*/);
The error message I get:
solution.o: In function `CProcManager::CProcManager(unsigned char*, unsigned int)':
/home/Jan/OSY/OSY-2/solution.cpp:19: undefined reference to `vtable for CProcManager'
solution.o: In function `CProcManager::~CProcManager()':
/home/Jan/OSY/OSY-2/solution.cpp:15: undefined reference to `vtable for CProcManager'
collect2: error: ld returned 1 exit status
make: *** [test1] Error 1
All the methods of CCPU and CProcManager classes are defined and I am not supposed to change the CCPU class (this class was provided in the project assignment).
Can someone please explain to me where the problem lies(I guess its something with definitions)?