[aspectc-user] Compiling helloworld aspect C++ on Symbian

Marti Bayo-alemany malemany at nero.com
Fri Sep 2 15:42:38 CEST 2005


Hi,

It was nice :-) It worked if I set up that ...
  advice execution("% CEXampleApplication::%(...)") : around()  {
Now I set up ...
  advice execution("% CEXampleApplication::%(...)") : around()  {
and I've got some problems...

In file included from :1,
                 from source/helloworld_application.cpp:14:
source/aspect.ah:4: syntax error before `{' token
source/aspect.ah:7: syntax error before `.' token
source/aspect.ah:8: ISO C++ forbids declaration of `Write' with no type
source/aspect.ah:8: `int RFileLogger::Write' is not a static member of 
`class
   RFileLogger'
source/aspect.ah:8: initializer list being treated as compound expression
source/aspect.ah:8: cannot convert `TPtrC' to `int' in initialization
source/aspect.ah:10: syntax error before `->' token
source/aspect.ah:12: syntax error before `.' token
source/aspect.ah:13: ISO C++ forbids declaration of `Write' with no type
source/aspect.ah:13: `int RFileLogger::Write' is not a static member of 
`class
   RFileLogger'
source/aspect.ah:13: initializer list being treated as compound expression
source/aspect.ah:13: cannot convert `TPtrC' to `int' in initialization
source/aspect.ah:15: parse error before `}' token

The aspect.ah code is the following...

#include <flogger.h>
#include <e32std.h>

aspect Action {
  advice execution("% CExampleApplication::%(...)") : around()  {
    TBuf<100> l_Message;
    l_Message.Format(_L("CExampleApplication: before(exec) 
%s\n"),JoinPoint::signature());
    RFileLogger::Write(_L("NSTMLogDir"),_L("AspectsTest"),EFileLoggingModeOverwrite,_L("Test"));

    tjp->proceed();

    l_Message.Format(_L("CExampleApplication: after(exec) 
%s\n"),JoinPoint::signature());
    RFileLogger::Write(_L("NSTMLogDir"),_L("AspectsTest"),EFileLoggingModeOverwrite,_L("Test"));

  }
};

Best regards,
Marti

----- Original Message ----- 
From: "Olaf Spinczyk" <Olaf.Spinczyk at informatik.uni-erlangen.de>
To: "Marti Bayo-alemany" <malemany at nero.com>
Cc: <aspectc-user at aspectc.org>
Sent: Friday, September 02, 2005 3:33 PM
Subject: Re: [aspectc-user] Compiling helloworld aspect C++ on Symbian


> Hi,
>
> Marti Bayo-alemany wrote:
>> It seems that Aspect C++ doesn't support __declspec(dllexport)  which is 
>> needed in order to get an application running on Symbian
>>  #define *EXPORT_C* __declspec(dllexport)
>> EXPORT_C CApaApplication* NewApplication()
>>  I get that ...
>> invalid declaration near token `dllexport'
>>  I comment the EXPORT_C before ac++ and I added after EXPORT_C manually 
>> to the file generated.
>
> you should try to generate your parser configuration file with
>
> ag++ -o <parser config file> --gen_config --c_compiler <your g++>
>
> I guess, that __declspec is predefined as __attribute__ by the symbian 
> g++. Generating the config file will retrieve all the predefined macros 
> and include files from g++.
>
>> The application compiles and it runs on the mobile phone.
>>  However is still not doing what I am expecting but I am on the way.
>
> Fine, it seems that you have faster success than Bil one year ago.
>
> Best regards,
>
> Olaf
>
> 




More information about the aspectc-user mailing list