[aspectc-user] ag++

Yang Zhang yanghatespam at gmail.com
Wed Feb 18 07:20:22 CET 2009


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/



More information about the aspectc-user mailing list