Hallo,<br>danke für Ihre Antwort. Ja, "}" habe ich vergessen, aber nur auf mail.<br>Ich habe noch einmal getestet, leider tretet die gleiche Fehlermeldung<br>auf. Ich nutze ac++ Version 1.0.0.3 mit<br><br>D:\ac++>ac++ -p examples\test -d examples\test-out -Iexamples\test -v9<br>
* Running ac++ 1.0pre3<br>* Simple Dependency Check<br> - new or modified: examples/test/test.ah<br>* Handling Translation Unit `main.cc'.<br> - Path "examples/test/main.cc"<br> - Inserting namespace AC<br>
- Parsing ...<br> - Setting Aspect Access Priviledges ...<br> - Weaving Introductions ...<br> - intros for test<br> - Aspect ordering ...<br> - Final checks before weaving introductions<br> - Class Join Points<br>
- Weaving Advice Declarations ...<br> test::%a0_before<br> - Weaving Singleton Aspects ...<br> - Slice/Intro Includes ...<br> - Commiting<br> - Parsing again ...<br> - Weaving Join Points ...<br> Advicecode manipulation<br>
Collecting Advice<br> Setting up thisJoinPoint for aspectof<br> Supplying aspectof() with JoinPoint and tjp if needed<br> test: __a0_before<br> Evaluate Pointcut<br> Aspect ordering ...<br> Final checks before weaving code join points<br>
Type Check Functions<br> Call Join Points<br> Execution Join Points<br> void func1()<br> Construction Join Points<br> Destruction Join Points<br> - Aspect Includes ...<br> - Final cleanup<br> - Commiting<br>
* Handling include files<br> - Handling Translation Unit `ac_gen.cc'.<br> Path "examples/test/ac_gen.cc"<br> Inserting namespace AC<br> Parsing ...<br> Setting Aspect Access Priviledges ...<br> Weaving Introductions ...<br>
intros for test<br> Aspect ordering ...<br> Final checks before weaving introductions<br> Class Join Points<br> Weaving Advice Declarations ...<br> test::%a0_before<br> Weaving Singleton Aspects ...<br>
Slice/Intro Includes ...<br> Commiting<br> Parsing again ...<br>examples/test/test.ah:10: error: `func2' undeclared here<br> Aborting<br><br>ich kopere die testcode noch einmal hier<br><br>---------------------main.cc--------------------------<br>
<br>#include <stdio.h><br><br>void func1 ( ) { };<br>void func2 ( ) { };<br>int main ( ) {<br> func1 ( );<br> //func2 ( );<br>};<br><br><br>---------------------test.ah-------------------------------<br>
<br>#include <stdio.h><br><br>aspect test { <br><br>public:<br><br> advice execution("% func1 (...) ") : before () {<br> func2 ( );<br> }<br>};<br>--------------------------------------------<br>
am Beispiel2 ich ähnliches Problem.<br><br>Gruss<br>Du Bin<br><br><br><br><br><div class="gmail_quote">2010/4/1 <span dir="ltr"><<a href="mailto:aspectc-user-request@aspectc.org">aspectc-user-request@aspectc.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send aspectc-user mailing list submissions to<br>
<a href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://www.aspectc.org/mailman/listinfo/aspectc-user" target="_blank">http://www.aspectc.org/mailman/listinfo/aspectc-user</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:aspectc-user-request@aspectc.org">aspectc-user-request@aspectc.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:aspectc-user-owner@aspectc.org">aspectc-user-owner@aspectc.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of aspectc-user digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. function call (Bin Du)<br>
2. Re: function call (Olaf Spinczyk)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 1 Apr 2010 11:19:26 +0200<br>
From: Bin Du <<a href="mailto:bin.du.rbst@gmail.com">bin.du.rbst@gmail.com</a>><br>
Subject: [aspectc-user] function call<br>
To: <a href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
Message-ID:<br>
<<a href="mailto:z2jcd5eff181004010219o463b7eb8w3d1f4194692516e9@mail.gmail.com">z2jcd5eff181004010219o463b7eb8w3d1f4194692516e9@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
hi all,<br>
i have a question, haw can i call a c++ function in aspectc++<br>
<br>
-------------main.cc----------------------<br>
<br>
void func1 ( ) { ... };<br>
void func2 ( ) { ... };<br>
int main ( ) {<br>
func1 ( );<br>
//func2 ( );<br>
}<br>
<br>
-----------test.ah--------------------<br>
<br>
aspect test{<br>
advice execution("% func1 (...) ") : before () {<br>
func2 ( );<br>
};<br>
<br>
ac++ issues the error:<br>
error: `func2' undeclared here<br>
<br>
<br>
----------------------- main2.cc-----------------<br>
<br>
class Base1<br>
{<br>
public:<br>
void ba1 ()<br>
{<br>
printf("Base2::b1 ()\n");<br>
}<br>
}base1;<br>
<br>
class Base<br>
{<br>
public:<br>
<br>
int b2 (inti)<br>
{ inttemp = i;<br>
return temp;<br>
}<br>
} *a ;<br>
<br>
int main()<br>
{<br>
<br>
a->b2(0);<br>
<br>
//base1.b1(); same problem<br>
<br>
return 0;<br>
}<br>
<br>
Thanks in advance,<br>
du bin<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://www.aspectc.org/pipermail/aspectc-user/attachments/20100401/6a2fe785/attachment-0001.html" target="_blank">http://www.aspectc.org/pipermail/aspectc-user/attachments/20100401/6a2fe785/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 01 Apr 2010 11:45:45 +0200<br>
From: Olaf Spinczyk <<a href="mailto:os@aspectc.org">os@aspectc.org</a>><br>
Subject: Re: [aspectc-user] function call<br>
To: <a href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
Message-ID: <<a href="mailto:4BB46B49.50703@aspectc.org">4BB46B49.50703@aspectc.org</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
Hello!<br>
<br>
I tested your first example and it works here.<br>
<br>
Have you noticed that the closing bracket "}" of your advice code is<br>
missing?<br>
<br>
In the second example the call goes to b1(), but the function is named<br>
ba1().<br>
<br>
Best regards,<br>
<br>
Olaf Spinczyk<br>
<br>
<br>
Bin Du wrote:<br>
> hi all,<br>
> i have a question, haw can i call a c++ function in aspectc++<br>
><br>
> -------------main.cc----------------------<br>
><br>
> void func1 ( ) { ... };<br>
> void func2 ( ) { ... };<br>
> int main ( ) {<br>
> func1 ( );<br>
> //func2 ( );<br>
> }<br>
><br>
> -----------test.ah--------------------<br>
><br>
> aspect test{<br>
> advice execution("% func1 (...) ") : before () {<br>
> func2 ( );<br>
> };<br>
><br>
> ac++ issues the error:<br>
> error: `func2' undeclared here<br>
><br>
><br>
> ----------------------- main2.cc-----------------<br>
><br>
> class Base1<br>
> {<br>
> public:<br>
> void ba1 ()<br>
> {<br>
> printf("Base2::b1 ()\n");<br>
> }<br>
> }base1;<br>
><br>
> class Base<br>
> {<br>
> public:<br>
><br>
> int b2 (inti)<br>
> { inttemp = i;<br>
> return temp;<br>
> }<br>
> } *a ;<br>
><br>
> int main()<br>
> {<br>
><br>
> a->b2(0);<br>
><br>
> //base1.b1(); same problem<br>
><br>
> return 0;<br>
> }<br>
><br>
> Thanks in advance,<br>
> du bin<br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> aspectc-user mailing list<br>
> <a href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
> <a href="http://www.aspectc.org/mailman/listinfo/aspectc-user" target="_blank">http://www.aspectc.org/mailman/listinfo/aspectc-user</a><br>
><br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
aspectc-user mailing list<br>
<a href="mailto:aspectc-user@aspectc.org">aspectc-user@aspectc.org</a><br>
<a href="http://www.aspectc.org/mailman/listinfo/aspectc-user" target="_blank">http://www.aspectc.org/mailman/listinfo/aspectc-user</a><br>
<br>
<br>
End of aspectc-user Digest, Vol 2, Issue 1<br>
******************************************<br>
</blockquote></div><br>