[aspectc-user] ac++ passed, but c++ -compiler rejects

Martin Kuhlemann martin.kuhlemann at web.de
Sat Dec 10 21:36:30 CET 2005


the following aspect causes trouble with my MS Toolkit 2003-Compiler.
The aspectC++-Compiler is passed and the output-code is generated so 
far("void Subject::subscribe()" and "void Subject::subscribe(Observer* 
newClient)" are allready existent in the Components):

#ifndef __connect_ah
#define __connect_ah

#include <iostream>
#include <string>
using namespace std;

//#include "Observer.h"
#include "ConcreteObserver.h"
//#include "ConcreteSubject.h"

//class Observer;
//class ConcreteObserver;

aspect connect{
	pointcut Methods() = execution("% %::subscribe()");

	advice Methods() : after(){
		cout<<"hier soll was eingefügt werden"<<endl;
		string name = "Observer3";
		Observer* newClient = new ConcreteObserver(name);
		string temp = newClient->toString();
//		tjp->that()->subscribe(newClient);
		cout<<"subscribed "<<newClient->toString()<<endl;

The error of the 2003 Toolkit is:

c:\Dokumente und Einstellungen\martin\Desktop\ObserverAOPAcOk_ClFail\observerAOP
-out\Subject.h(93) : fatal error C1070: mismatched #if/#endif pair in file 
'c:\dokumente und 
Generating Code...

(The weird thing is, that, when all but the first "cout" is commented out, 
the ac++ -Compiler in the version 0.9 produces an output, so that the 
resulting main.exe correctly writes "hier soll was eingefügt werden".)

Is there anything wrong with my code? (If needed, I also can send my 

Thank you very much and best Regards.

More information about the aspectc-user mailing list