avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Problems with abstract classes / pure virtual functio


From: E. Weddington
Subject: Re: [avr-gcc-list] Problems with abstract classes / pure virtual functions:
Date: Wed, 23 Feb 2005 09:21:00 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

address@hidden wrote:

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.

In general, there's not a lot of people who are using C++ on the AVR on this list, though there might be some....

If you don't get an answer in a reasonable amount of time, I would suggest that you post this on the GCC list....

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]