[aspectc-user] Compile problem with generated code

Oliver Zweigle Oliver.Zweigle at ipvs.uni-stuttgart.de
Thu Sep 18 15:39:20 CEST 2008


Hello,

I'm new to AspectC++ so if my problem is more or less simple I'm sorry.
Nevertheless I couldn't find a solution.
I want to compile a library with only one class and only one aspect for
testing. I tried to compile with the following command: 

ag++ RCNetworkInterface.C -c -g -Wall -p. -a RCAspects.ah
-march=prescott -O2 -pipe -fomit-frame-pointer -DQT_THREAD_SUPPORT
-D_REENTRANT -D_GNU_SOURCE -DLINUX -D_RobotControl_=\"RobotControl1-1\"
-I/home/zweiglor/robBK/PTHR/include -I/home/zweiglor/robBK/PFF/include
-I/home/zweiglor/robBK/RobotCom/include
-I/home/zweiglor/robBK/SUTIL/include
-I/home/zweiglor/robBK/DConf/include
-I/home/zweiglor/robBK/RobotControl/include
-I/home/zweiglor/robBK/SocketComm/include 
-I/usr/share/qt3/include 
-o LINUX/RCNetworkInterface.o

The complilation process always throws errors like:
LINUX/RCNetworkInterface.acc:173: error: 'class RCNetworkInterface' has
no member named '__exec_old_init'

I've also tried to simply weave the code with ac++ and compile it after
wards. But the result was the same. It seems to me that the weaver is
running into problems because of missing declarations.

It would be very nice if you could help me out.

Kind regards,
Oliver

The aspect file looks like this:

RCAspect.ah:

#include <cstdio>

aspect Tracing {
  advice execution ("% ...::%(...)") : before () {
    std::printf("in %s\n", JoinPoint::signature());
  }
};

the .h file looks like this:
RCNetwork.H

#include <sys/time.h>

#include "RobotCom/RMObserver.H"
#include "PTHR/locks.H"
#include <map>
#include <string>


class RCNetworkInterface : public RMObserver {

  public: 

  static RCNetworkInterface* getInstance();
  
  /// Constructor
  RCNetworkInterface();

  RCNetworkInterface(string host, string port, string id, string bmode,
bool isRobot);

  /// Destructor
  virtual ~RCNetworkInterface(void);

  
  bool readConfig();
  
  PTHR_rwlock rcMutex_;
    
  //protected:
  
  
  private:
  
  void Update(RobotMessage* rMessage, RobotMessage::SubMessageTypes
smType);
  bool init();

  static RCNetworkInterface *instance;
  static PTHR_mutex instanceMutex;

  bool mdpRunning_;
};

#endif


and the .C file like this:
RCNetworkInterace.C:


#include "RobotControl/RCNetworkInterface.H"

#include <stdlib.h>
#include <string>


#include "RobotCom/RCMessage.H"
#include "RobotCom/ReceivedMessages.H"
#include "RobotCom/ServerRequestMessage.H"
#include "RobotCom/ClientThread.H"
#include "RobotCom/SendMessages.H"

#include <assert.h>

using namespace std;

PTHR_mutex RCNetworkInterface::instanceMutex = PTHR_mutex();

RCNetworkInterface *RCNetworkInterface::instance = NULL;

RCNetworkInterface* RCNetworkInterface::getInstance() {
  PTHR_SimpleLock llock =
PTHR_SimpleLock(RCNetworkInterface::instanceMutex);

  if (instance == NULL) {
    instance = new RCNetworkInterface();
  }
  return instance;

}


//
----------------------------------------------------------------------
/** Constructor */
RCNetworkInterface::RCNetworkInterface() {
  init();
}

RCNetworkInterface::RCNetworkInterface(string host, string port, string
id, string bmode, bool isRobot) {
  init();
}

bool RCNetworkInterface::init() {
  ReceivedMessages::getInstance()->Attach(this, "Robot_Control");  
  return true;
}


//
----------------------------------------------------------------------
/** Destructor */
RCNetworkInterface::~RCNetworkInterface(void) {
  ReceivedMessages::getInstance()->Detach(this, "Robot_Control"); 
  
}

void RCNetworkInterface::Update(RobotMessage* rMessage,
RobotMessage::SubMessageTypes smType) {
 
}



-- 
Dipl.- Inf. Oliver Zweigle 
IPVS - University of Stuttgart
Universitätsstr. 38
D-70569 Stuttgart, Germany
http://www.ipvs.uni-stuttgart.de/abteilungen/bv
Phone: +49 711 7816-421
Mail: Oliver.Zweigle at ipvs.uni-stuttgart.de




More information about the aspectc-user mailing list