[aspectc-user] Compile problem with generated code

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


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
-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,

The aspect file looks like this:


#include <cstdio>

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

the .h file looks like this:

#include <sys/time.h>

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

class RCNetworkInterface : public RMObserver {


  static RCNetworkInterface* getInstance();
  /// Constructor

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

  /// Destructor
  virtual ~RCNetworkInterface(void);

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

  static RCNetworkInterface *instance;
  static PTHR_mutex instanceMutex;

  bool mdpRunning_;


and the .C file like this:

#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 =

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


/** Constructor */
RCNetworkInterface::RCNetworkInterface() {

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

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
Phone: +49 711 7816-421
Mail: Oliver.Zweigle at ipvs.uni-stuttgart.de

More information about the aspectc-user mailing list