[aspectc-user] Problems with AspectC++ and Include Files

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Wed Dec 14 20:34:18 CET 2005

Hello Roberta,

the statement "AspectC++ does not work well when a C++ class has header 
files which include other header files" is not true. You (or someone 
else) probably misinterpreted the behavior of ac++.

There was a problem (the "include cycle problem") in ac++ version prior 
to 1.0pre1, but this is a little bit more complicated than the statement 

As a general advice, I would recommend the following steps:

1) modify your build environment in order to compile your program with ac++.
   Preferebly, use the ag++ wrapper program (for ac++ & g++). Don't use any
   aspects now. If ac++ has problems to parse the code or if the code 
does not
   work as usual, contact me description of the parse problem. The best 
is a simple
   short code fragment that does not depend an any non-standard header 
file, which
   we can use to reproduce the problem.

2) When the compilation works, start with a single and simple aspect. Then
    extend your aspect code in small steps.

Introdroducing step by step helps to find the reason for a problem a lot.

Now back to your case: Do you have a compilation problem (are you still 
in step 1) or do you have an aspect-specific problem (step 2)?

There is no general problem with 170 classes and 54 files, but a single 
simple parser bug can spoil everything.


Roberta Coelho wrote:
> Hi,
> I trying to "aspectualize" some concerns a real project developed in 
> C++  (170 classes and 54 c files).
> My project does not compile when I include some aspects using 
> AspectC++. :-/
> After "googling"  about what could be wrong, I found out that a 
> message from 2004 which stated that: AspectC++ does not work well when 
> a C++ class has header files which include other header files.
> Does AspectC++ still have this limitation?
> []'s
> Roberta
>aspectc-user mailing list
>aspectc-user at aspectc.org

More information about the aspectc-user mailing list