[aspectc-user] ag++

Stefan Marr aspectc at stefan-marr.de
Wed Feb 18 07:58:55 CET 2009


Hi,

your aspect definition has to be in a .ah file to be recognized.  
Otherwise you have to give a special parameter to ag++.

Regards
Stefan

On 18 Feb 2009, at 07:20, Yang Zhang wrote:

> Hi, I can't seem to get started with the apt-installed ag++.  I'm  
> basically trying to compile the example given in the quick  
> reference. Thanks in advance for any hints.
>
> yang at yang-xps410 ~/sandbox/cc
> $ ag++ --version
> ag++ 0.7  built: May 11 2008
>
> yang at yang-xps410 ~/sandbox/cc
> $ cat acpp.cc
> #include <iostream>
> using namespace std;
> aspect Trace {
>  pointcut functions() = "% main(...)";
>  advice execution(functions()) : around() {
>    cout << "before" << JoinPoint::signature() << "(";
>    for (size_t i = 0; i < JoinPoint::ARGS; ++i)
>      cout << (i ? ", " : "") << JoinPoint::argtype(i);
>    cout << ")" << endl;
>    tjp->proceed();
>    cout << "after" << endl;
>  }
> };
> int main() {
>  return 0;
> }
>
> yang at yang-xps410 ~/sandbox/cc
> $ ag++ acpp.cc -o acpp
> acpp.cc:1: error: invalid declaration near token `aspect'
> error: Execution failed: "ac++" --config "/tmp/agxx_pcfg4Qy53f"  -p.  
> -c "acpp.cc" -o "/tmp/acpp.cc_agxx_knLdsM"
> -- 
> Yang Zhang
> http://www.mit.edu/~y_z/
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user

-- 
Stefan Marr
Programming Technology Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://prog.vub.ac.be/~smarr




More information about the aspectc-user mailing list