BCC? [aspectc-user at aspectc.org] [aspectc-user] (no subject)
Holger Papajewski
holger.papajewski at pure-systems.com
Tue Apr 22 16:17:14 CEST 2003
Sven.Apel at metop-md.de wrote:
>
> Hello,
>
> I have tried to build the following example with Visual Studio .Net and
> the AspectC++ Add-In:
>
> #include <stdio.h>
>
> aspect Trace {
> pointcut trace_func () = "% TraceTest::test(...)";
>
> advice execution(trace_func()) : around ()
> {
> printf("before");
> thisJoinPoint->action().trigger();
> printf("after");
> }
> };
>
> I get the following error:
>
> ./ac_gen.cc(22): error C2011: 'Trace' : 'class' type redefinition
>
> What's the problem with this example?
You need a #ifndef/#endif inside the aspect header.
#ifndef __aspect_xx__
#define __aspect_xx__
aspect { ... };
#endif
Holger
--
Holger Papajewski Phone: (+49) 0391 544569-20
pure-systems GmbH Fax: (+49) 0391 544569-90
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3148 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20030422/240f97d1/attachment.bin>
More information about the aspectc-user
mailing list