[aspectc-user] about introducing static const data members

Daniel Lohmann daniel.lohmann at informatik.uni-erlangen.de
Sun Jan 6 22:38:19 CET 2008


On 05.01.2008, at 16:52, Panu Bloigu wrote:

> Hello.
>
> I have an aspect that introduces a static const data member of class  
> type into a class. Thanks to Daniel's explanation on this list on  
> 2007-01-10, I managed to get the syntax right and make ac++ to  
> compile the code, yet issuing a warning:
>
> 'warning: cannot introduce non-inline function or static attribute  
> into "class MyClass". It has to contain link-once code.'
>
> What does that mean exactly? What kind of a problem I'm looking at  
> here? I tried this with 1.0pre3.

Hi Panu,

You class has to have at least one associated translation unit (.cpp  
file), that is, at least one non-inline member function or static data  
element that is defined in some translation unit. The weaver needs  
this to find the "right" .cpp file to introduce the definition of your  
static data member.

Daniel



More information about the aspectc-user mailing list