[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Problems with abstract classes / pure virtual functions:
From: |
Thomas . Schulze |
Subject: |
[avr-gcc-list] Problems with abstract classes / pure virtual functions: |
Date: |
Wed, 23 Feb 2005 14:30:04 +0100 |
Hi!
I got a somehow mysterious (hopefully not to silly) problem involving abstract classes.
Here a test:
class abstract_base
{
public:
virtual void testfunction(void)=0;
virtual ~abstract_base(){} *
};
class concrete_class : public abstract_base
{
public:
void testfunction(void){}
~concrete_class(){}
};
Now I do the following:
int main(void)
{
concrete_class testobject;
}
And the Compiler warns me about:
warning: alignment of 'concrete_class::_ZTV14concrete_class' is greater than maximum object file alignment. Using 1
warning: alignment of 'abstract_base::_ZTV13abstract_base' is greater than maximum object file alignment. Using 1
And the Linker finally generates an error:
....h:8: undefined reference to `__cxa_pure_virtual' ( which is actually the line marked by *)
If You have any clues, why that problem shows up, please give me a hint.
Thancs a lot
Thomas
- [avr-gcc-list] Problems with abstract classes / pure virtual functions:,
Thomas . Schulze <=