[aspectc-user] gen_size_type: <anonymous unit>:67: error: `operator new' already defined

Guilherme . guibufolo at gmail.com
Wed May 11 17:32:48 CEST 2011


Hi!

when using the option gen_size_type to create a operator new that uses a
custom size type for cross compiling i get following error:

ag++ -v9 --gen_size_type="\"long unsigned int\"" main.cpp -o main
*
*
* AG++ Configuration:
*   Aspect C++ weaver:  ac++
*   C++ compiler:       g++
*   Files:               main.cpp
*   Options (G++):       -v -I "."  -o "main"
*   Options (AC++):      -v9 --gen_size_type="long unsigned int" -p.
*   Options (total):     -v9 -v --gen_size_type="long unsigned int" main.cpp
-I "."  -o "main"  -p.
*   PumaConfig: 1 Weave: 1 Compile: 1 Link: 1
*
*
* Generating Puma configuration file
  - Parsing output of g++ compiler
  - Executing: "g++"  -E -dM -v -x c++ "/dev/null" 2>/tmp/agxx_stderrGzhsj8
1>/tmp/agxx_stdoutSM76cu
  - Exit: Success
  - removing temporary file: /tmp/agxx_stdoutSM76cu
  - removing temporary file: /tmp/agxx_stderrGzhsj8
  - Writing puma configuration file '/tmp/agxx_pcfggiCN6P'
* Weaving
  - Executing: "ac++" --config "/tmp/agxx_pcfggiCN6P"  -v9
--gen_size_type="long unsigned int" -p. -c "main.cpp" -o
"/tmp/main.cpp_agxx_Ki14TM"
* Running ac++ 1.0
* Handling Translation Unit `main.cpp'.
  - Path "main.cpp"
  - Inserting namespace AC
  - Parsing ...
<anonymous unit>:67: error: `operator new' already defined
test.ah:8: error: `execution' undeclared here
  - Aborting
error: Execution failed: "ac++" --config "/tmp/agxx_pcfggiCN6P"  -v9
--gen_size_type="long unsigned int" -p. -c "main.cpp" -o
"/tmp/main.cpp_agxx_Ki14TM"

Both files are really simple:

cat test.ah

#ifndef __SIMPLE_H__
#define __SIMPLE_H__

#include <stdio.h>

aspect simple{
    advice call("%main%") : before(){
        printf("test\n");
    }
}
#endif

cat main.cpp

int main(int, char**){

    return 0;
}

How do i get around this error?

I need this for when compiling an application with headers created with the
-i option. There i receive the same error.

Cheers,
Guilherme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20110511/d61942d0/attachment.html>


More information about the aspectc-user mailing list