[aspectc-user] ElementCounter: `util' was not declared in this scope
Olaf Spinczyk
Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Jul 8 10:49:42 CEST 2005
Pablo,
Pablo Casado wrote:
> Hi,
>
> I installed acdt-2.0.3 and went through the tutorial examples, all
> compiled and ran without problems using managed makefiles except for
> ElementCounter. The compiler errors are listed below.
>
> I am using
> eclipse 3.0.0
> acdt-2.0.3
> ac 0.9.3 (disabled the plugin in acdt)
> mingw
> windows xp (sp2)
> The tutorial source files I extracted from aosd-2005-tut.zip
>
> ag++ -r repo.acp -p .. -c ../main.cc
> ../ElementCounter2.ah:13: `util' was not declared in this scope
> ../ElementCounter2.ah:13: parse error before `::' token
> ../ElementCounter2.ah:19: `util' was not declared in this scope
> ../ElementCounter2.ah:19: parse error before `::' token
> ../ElementCounter2.ah:24: `util' was not declared in this scope
> ../ElementCounter2.ah:24: parse error before `::' token
> ../ElementCounter2.ah: In member function `void
> ElementCounter2::__a0_before(...)':
> ../ElementCounter2.ah:14: `queue' undeclared (first use this function)
> ../ElementCounter2.ah:14: (Each undeclared identifier is reported only
> once for
> each function it appears in.)
> : In function `void
> AC::invoke_ElementCounter2_ElementCounter2_a0_before(JoinPoint*)':
> :5: parse error before `::' token
> : In function `void
> AC::invoke_ElementCounter2_ElementCounter2_a1_after(JoinPoint*)':
> :10: parse error before `::' token
> : In function `void
> AC::invoke_ElementCounter2_ElementCounter2_a2_after(JoinPoint*)':
> :15: parse error before `::' token
> error: Execution failed: ""g++" -c -xc++ "main.acc" -xnone"
this is a bug in ac++ 0.9.3, which affects aspects that perform an
introduction into a class, have code advice on join points in the same
class, and include the header file of the class. Exactly, all these
circumstances come together in ElementCounter2.
If you only want all examples to compile, downgrade to the 0.9.2 version
of the ac++ compiler feature in your eclipse environment.
If you want a workaround that helps with ac++ 0.9.3, replace:
that(queue): before (util::Queue& queue) { with
that("util::Queue") : before () { JoinPoint::That &queue = tjp->that();
If you use the JoinPoint-API and don't reference the type util:Queue
anymore, you can delete the #include "queue.h". Then it will work again.
The bug is already fixed internally.
Sorry for this,
Olaf
More information about the aspectc-user
mailing list